C++11 memory pool design pattern?

In case you haven’t already, familiarize yourself with Boost.Pool. From the Boost documentation: What is Pool? Pool allocation is a memory allocation scheme that is very fast, but limited in its usage. For more information on pool allocation (also called simple segregated storage, see concepts concepts and Simple Segregated Storage. Why should I use Pool? … Read more

What does posix_memalign/memalign do

Whereas malloc gives you a chunk of memory that could have any alignment (the only requirement is that it must be aligned for the largest primitive type that the implementation supports), posix_memalign gives you a chunk of memory that is guaranteed to have the requested alignment. So the result of e.g. posix_memalign(&p, 32, 128) will … Read more