Memory pools implementation in C
I am looking for a good memory pool implementation in C. it should include the following: Anti fragmentation. Be super fast :) Ability to "bundle" several allocations from different sizes under some identifier and delete all the allocations with the given identifier. Thread safe I think the excellent talloc , developed as part of samba might be what you're looking for. The part I find most interesting is that any pointer returned from talloc is a valid memory context. Their example is: struct foo *X = talloc(mem_ctx, struct foo); X->name = talloc_strdup(X, "foo"); // ... talloc_free(X); //