aboutsummaryrefslogtreecommitdiffstats
path: root/include/secmem.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/secmem.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/secmem.h')
-rw-r--r--include/secmem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/secmem.h b/include/secmem.h
index 84c821ec7..7873c8b1f 100644
--- a/include/secmem.h
+++ b/include/secmem.h
@@ -75,8 +75,8 @@ class MemoryRegion
set(copy.buf, copy.used);
}
- void init(bool lock, u32bit size = 0)
- { alloc = get_allocator(lock ? "" : "malloc"); create(size); }
+ void init(bool locking, u32bit size = 0)
+ { alloc = Allocator::get(locking); create(size); }
private:
T* allocate(u32bit n) const { return (T*)alloc->allocate(sizeof(T)*n); }
void deallocate(T* p, u32bit n) const