Memory pool. C++. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Memory pool. C++.

Can someone tell about memory pool. I can't finding anything sensible. I would like to see an example. Thanks!

29th Sep 2018, 11:07 PM
SDA21
SDA21 - avatar
3 Answers
0
I've never heard of a "memory pool" specifically. Maybe it's just a concept. I know that in C++ there's a thing called the runtime stack, which if you're not familiar with the stack, it might be worth looking into. The runtime stack is when variables are implicitly pushed onto the stack when they're initialised or assigned. There is also the Heap, where the user explicitly allocates the memory with the keyword "new". I'd think a memory pool would be the total memory allocated by either exclusively the Heap or both, of someone could confirm that...
30th Sep 2018, 12:04 AM
Justin Petluk
Justin Petluk - avatar
0
It's a just bid memory allocation in advance and using it as a storage of many small data pieces. When there is no place for a new data piece the new allocation is performed. It is used to increase performance by reducing memory allocations. I didn't see significant speed difference between system allocator and memory pool with last compilers and OSes.
30th Sep 2018, 7:23 AM
Sergey Ushakov
Sergey Ushakov - avatar