diff options
author | lloyd <[email protected]> | 2006-09-11 00:44:28 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-11 00:44:28 +0000 |
commit | 31170c2210d98c2ea8f3fac56ff5f31e27f741af (patch) | |
tree | b43349234dfb36ae0b6e3ea97923e7f5f52eb06e /src/mem_pool.cpp | |
parent | a563159b999eea2fee0ea94d0baaea06df0ca1df (diff) |
Correctly deal with allocators added post-initialization. In particular,
handle the case where an allocator is added that has the same name as one
already registered.
Flush the cached allocator pointer when the default is changed.
Mark comparison operations in Pooling_Allocator::Memory_Block as inline;
this seems to help the STL sort and binary search algorithms tremendously.
Diffstat (limited to 'src/mem_pool.cpp')
-rw-r--r-- | src/mem_pool.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/mem_pool.cpp b/src/mem_pool.cpp index 00a9f2d06..24866d172 100644 --- a/src/mem_pool.cpp +++ b/src/mem_pool.cpp @@ -52,7 +52,7 @@ Pooling_Allocator::Memory_Block::Memory_Block(void* buf, u32bit map_size, /************************************************* * Compare a Memory_Block with a void pointer * *************************************************/ -bool Pooling_Allocator::Memory_Block::operator<(const void* other) const +inline bool Pooling_Allocator::Memory_Block::operator<(const void* other) const { if(buffer <= other && other < buffer_end) return false; @@ -60,14 +60,6 @@ bool Pooling_Allocator::Memory_Block::operator<(const void* other) const } /************************************************* -* Compare two Memory_Block objects * -*************************************************/ -bool Pooling_Allocator::Memory_Block::operator<(const Memory_Block& blk) const - { - return (buffer < blk.buffer); - } - -/************************************************* * See if ptr is contained by this block * *************************************************/ bool Pooling_Allocator::Memory_Block::contains(void* ptr, |