patch: bitmap_allocator.h
Dhruv Matani
dhruvbird@gmx.net
Tue Jul 20 14:21:00 GMT 2004
Hi,
I've gotten the bitmap_allocator to work fine when compiled as the
default using --enable-libstdcxx-allocator=bitmap. This patch implements
that. However, there is scope for some other parts of the allocator to
be split up into separate units(files), which are independent of each
other. I can do that only if that is required, because all allocators
upto now are self-sustaining files by themselves.
Tested x86-Linux.
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
template<typename Signature>
class CustomSignature : public Signature
{ };
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.balloc.dhruv.20072004
Type: text/x-patch
Size: 62130 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040720/bdffe155/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.allocator.cc.dhruv.20072004
Type: text/x-patch
Size: 879 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040720/bdffe155/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.allocator-inst.cc.dhruv.20072004
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040720/bdffe155/attachment-0002.bin>
-------------- next part --------------
2004-07-20 Dhruv Matani <dhruvbird@gmx.net>
* include/ext/bitmap_allocator.h: Remove functions __bit_alloc,
__bit_free, __memory_get, __memory_put in lieu of macros
_BIT_ALLOC, _BIT_FREE, _MEMORY_GET, _MEMORY_PUT.
Introduce a new class __mini_vector<>, which defines the
minimalistic requirements for the bitmap_allocator. This should be
instantiated only for PODs.
Removed _OOM_handler. Instead, added an explicit try-catch block
in the get memory function for the free list.
Most of the static functions are now members.
* src/allocator.cc: Added the entries for
bitmap_allocator. Explicit instatiation of
__gnu_cxx::balloc::__lower_bound<> for the free_list's purposes.
* src/allocator-inst.cc: Added the include for bitmap_allocator,
and the instantiations for bitmap_allocator<char/wchar_t>.
More information about the Libstdc++
mailing list