Boost Memory Library: boost-memory-0.1.00
What is new?
- Lock-free free list.
- Provide both region allocators (boost::auto_alloc, boost::scoped_alloc) and general-purpose allocators (boost::gc_alloc).
Highlights
- Allocating memory is very fast.
- No memory leaks. No need to delete objects manually. Or forgetting to delete objects is allowed.
Source code
To gain the source code, you can:
- Download from Boost Vault or http://code.google.com/p/stdext/downloads/list.
- Svn checkout http://winx.googlecode.com/svn/tags/boost-memory-0.1.00/.
- Svn checkout http://svn.boost.org/svn/boost/sandbox/memory/.
What is boost-memory?
It provides allocators named "GC Allocator". Note "GC Allocator" isn't GC.
GC Allocator is different from STL Allocator. The following is minimum specification for GC Allocator:
typedef void (*DestructorType)(void* data); concept GCAllocator { // Allocate memory without given a cleanup function void* allocate(size_t cb); // Allocate memory with a cleanup function void* allocate(size_t cb, DestructorType fn); // Cleanup and deallocate all allocated memory by this GC Allocator void clear(); // Swap two GCAllocator instances void swap(GCAllocator& o); };
For more information about GC Allocator, refer to http://www.codeproject.com/KB/cpp/gc-allocator.aspx
page_revision: 1, last_edited: 1210129318|%e %b %Y, %H:%M %Z (%O ago)