Basic memory pool, alignment, thread safety
Serious Bug

The moment you do this:


pool-&gt;memory = realloc(pool-&gt;memory, pool-&gt;memory_size);



all the existing head, next, ptr, and memory pointers become invalid, since they were pointing into the memory that was just freed.  So essentially, your memory pool becomes useless after you expand it.

Unsafe macros

This macro:


#define get_ptr_and_increase(pool, size) pool-&gt;memory; pool-&gt;memory += size



is unsafe for multiple reasons:


Arguments are not used inside parentheses, e.g. (pool)
The two statements could get split unexpectedly, such as in:

if (condition)
    p = get_ptr_and_increase(pool, size);



I suggest creating a static inline function instead:

static inline void *get_ptr_and_increase(MemoryPool *pool, size_t size)
{
    void *ret = pool-&gt;memory;
    pool-&gt;memory += size;
    ret += size;
}