PacktPublishing / Building-Low-Latency-Applications-with-CPP

Building Low Latency Applications with CPP by Packt Publishing
MIT License
399 stars 117 forks source link

Memory leak in MemPool #7

Open TarakanoLov opened 4 months ago

TarakanoLov commented 4 months ago

Hi, I'm reading https://github.com/PacktPublishing/Building-Low-Latency-Applications-with-CPP/blob/main/Chapter4/mem_pool.h and I can't understand why the destructor in deallocate is not called, it turns out after creation std::string will leak memory in place of the old std::string

linoxoidunix commented 3 months ago

it is mustn't a big problem for you. you can easy use other Memory impl here. For example this project https://github.com/cacay/MemoryPool

Hi, I'm reading https://github.com/PacktPublishing/Building-Low-Latency-Applications-with-CPP/blob/main/Chapter4/mem_pool.h and I can't understand why the destructor in deallocate is not called, it turns out after creation std::string will leak memory in place of the old std::string