wamalloc
As if there were not enough dynamic memory allocators floating around, I had to write my own one. Of course, I didn't start from scratch, but tried come up with an implementation of Maged M. Michael's Scalable Lock-Free Dynamic Memory Allocator.
Due to the need for a lock based allocator, I added a simplified variant which uses plain locking instead of atomic operations. The lock-free variant also features an implementation of hazard pointers, as described by the very same author referenced above. Otherwise the two variants are very similary.
Status
The allocator, as provided here, certainly isn't a drop-in replacement. It is more a proof-of-concept and could certainly use some cleanup. It comes with its own, trivial exerciser (AKA yet another micro-benchmark) and there's lots of duplicate code between the two variants.
Source Code
- 2010-07-14 - wamalloc-0.1.tar.bz2
- 2010-07-03 - published an adapted version of the lock-based variant on the pgsql-hackers mailing list
License: Boost Software License 1.0 (BSD like)