aboutsummaryrefslogtreecommitdiffstats
path: root/include/mem_pool.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-11 00:44:28 +0000
committerlloyd <[email protected]>2006-09-11 00:44:28 +0000
commit31170c2210d98c2ea8f3fac56ff5f31e27f741af (patch)
treeb43349234dfb36ae0b6e3ea97923e7f5f52eb06e /include/mem_pool.h
parenta563159b999eea2fee0ea94d0baaea06df0ca1df (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 'include/mem_pool.h')
-rw-r--r--include/mem_pool.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mem_pool.h b/include/mem_pool.h
index 59599d65c..e365cd29d 100644
--- a/include/mem_pool.h
+++ b/include/mem_pool.h
@@ -46,9 +46,9 @@ class Pooling_Allocator : public Allocator
byte* alloc(u32bit) throw();
void free(void*, u32bit) throw();
- bool cmp_mem(const void* x) const { return (*this) < x; }
bool operator<(const void*) const;
- bool operator<(const Memory_Block&) const;
+ bool operator<(const Memory_Block& other) const
+ { return (buffer < other.buffer); }
private:
typedef u64bit bitmap_type;
static const u32bit BITMAP_SIZE = 8 * sizeof(bitmap_type);