diff options
author | lloyd <[email protected]> | 2007-04-25 23:28:41 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-04-25 23:28:41 +0000 |
commit | 454d4d7edc20c10ed7219f45698486902bba4880 (patch) | |
tree | 47701fea57f0faf515973f5f0bd0c002644b328d /src | |
parent | c687e28e5a1bab7e2ce3595db1bac103f05d0875 (diff) |
Check in a working fix for the mem_pool issues encountered by some Visual
Studio users.
Diffstat (limited to 'src')
-rw-r--r-- | src/mem_pool.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/mem_pool.cpp b/src/mem_pool.cpp index 67da88a14..faf399ec6 100644 --- a/src/mem_pool.cpp +++ b/src/mem_pool.cpp @@ -42,16 +42,6 @@ Pooling_Allocator::Memory_Block::Memory_Block(void* buf) } /************************************************* -* Compare a Memory_Block with a void pointer * -*************************************************/ -inline bool Pooling_Allocator::Memory_Block::operator<(const void* other) const - { - if(buffer <= other && other < buffer_end) - return false; - return (buffer < other); - } - -/************************************************* * See if ptr is contained by this block * *************************************************/ bool Pooling_Allocator::Memory_Block::contains(void* ptr, @@ -207,7 +197,7 @@ void Pooling_Allocator::deallocate(void* ptr, u32bit n) const u32bit block_no = round_up(n, BLOCK_SIZE) / BLOCK_SIZE; std::vector<Memory_Block>::iterator i = - std::lower_bound(blocks.begin(), blocks.end(), ptr); + std::lower_bound(blocks.begin(), blocks.end(), Memory_Block(ptr)); if(i == blocks.end() || !i->contains(ptr, block_no)) throw Invalid_State("Pointer released to the wrong allocator"); |