redjack/libcork — pull request #59 by dcreager (2013-06-19 15:39:32+00:00)
Title: Hide mempool implementation details

The `cork_mempool` type is now completely opaque, which moves us one step closer to declaring a stable ABI for libcork. This means that you can no longer embed a `cork_mempool` directly into your own types. This gives us more flexibility in the future to change the implementation without breaking existing code.

(The main reason for allowing embedded `cork_mempool` objects was to let us implement `cork_mempool_new_object` as a static inline function. But that's not really useful; the performance benefit is negligible, and it complicates the API. So that's now a regular CORK_API function.)

As part of this update, the initialization and finalization callbacks now include a `user_data` parameter, like all good callbacks should. (We already had function pointer types for these callbacks, we just needed to use them!)

And lastly, the functions for allocating and freeing an object in the memory pool have been renamed to `cork_mempool_new_object` and `cork_mempool_free_object`. After all, they weren't creating or freeing the memory pool itself...