@@ -60,11 +60,13 @@ auto roundUp (::uint64_t val,::uint64_t multiple){
6060constexpr ::int32_t BufSize=1101000 ;
6161class ioUring {
6262 static constexpr int SubQ=512 ,MaxBatch=10 ,NumBufs=4 ;
63+ public:
64+ BufferCompressed<SameFormat,::int32_t ,BufSize> cmwBuf;
65+ private:
6366 ::io_uring rng{};
6467 ::iovec iov;
6568 ::msghdr mhdr{0 ,sizeof (::sockaddr_in),&iov,0 ,0 ,0 ,0 };
6669
67- BufferCompressed<SameFormat,::int32_t ,BufSize>& cmwBuf;
6870 int sentBytes=0 ,bufsUsed=NumBufs;
6971 int const pageSize,chunk1,chunk2,chunk3;
7072 char * const bufBase;
@@ -84,8 +86,8 @@ class ioUring{
8486 }
8587
8688 public:
87- ioUring (auto & buf, int udpSock):cmwBuf(buf)
88- , pageSize(::sysconf(_SC_PAGESIZE))
89+ ioUring (int udpSock):
90+ pageSize (::sysconf(_SC_PAGESIZE))
8991 ,chunk1(roundUp(NumBufs*udpPacketMax,pageSize))
9092 ,chunk2(roundUp(NumBufs*sizeof (::io_uring_buf),pageSize))
9193 ,chunk3(roundUp(SubQ*(sizeof (::io_uring_sqe)+2 *sizeof (::io_uring_cqe))+pageSize,pageSize))
@@ -355,8 +357,8 @@ int main (int pid,char** av)try{
355357 ::checkField (" Password" ,cfg.getline(' ' ));
356358 cred.password =cfg.getline ();
357359 ::signal (SIGPIPE,SIG_IGN);
358- auto & cmwBuf=* new BufferCompressed<SameFormat,:: int32_t ,BufSize> ;
359- ring= new ::ioUring{ cmwBuf,frntBuf. sock } ;
360+ ring= new ::ioUring{frntBuf. sock } ;
361+ auto & cmwBuf=ring-> cmwBuf ;
360362 ::login (cmwBuf,cred,sa,ac==3 );
361363 if (ac==3 ){
362364 ::printf (" Signup was successful\n " );
0 commit comments