The Apache Portable Runtime which as given as a reference does state that it has its own problems.
Quote:
REMARK: There is no limitation about memory chunk size that you can allocate by apr_palloc(). Nevertheless, it isn't a good idea to allocate large size memory chunk in memory pool. That is because memory pool is essentially designed for smaller chunks. Actually, the initial size of memory pool is 8 kilo bytes. If you need a large size memory chunk, e.g. over several mega bytes, you shouldn't use memory pool.
and
Quote:
REMARK: By default, memory pool manager never returns allocated memory back to the system. If a program runs for a long time, it would have problem.
Also looking at the API it does seam overly complex in that you have now burdened the developer with keeping track of the various pointers to the memory pools.
With the g_slice_alloc() and g_slice_new() functions if the memory to be allocated is small it would be placed in a memory pool that has the same size. When freeing the memory you must know what the size of the memory block is.
Another option is to use the Glib data types if this fits in with how you are using your allocated sections of memory. There are many different data types including arrays and linked lists and all offer an option of freeing all allocated memory in one go if you wish. This way you will integrate better with the rest of the Glib/GDK/GTK libraries.