aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorlloyd <[email protected]>2007-01-08 20:42:41 +0000
committerlloyd <[email protected]>2007-01-08 20:42:41 +0000
commit0b1e07c3a16a789ecee37e2819f1740c509f7fa0 (patch)
treeb2a74fa561af6b54529a4f7964c8a336ed2afefb /include
parent0ccf1c63617d957fd7ddd1f9f5897e5a80d80c15 (diff)
Work around some strange Visual Studio bugs that popped up when compiling
mem_pool.cpp with debug enabled.
Diffstat (limited to 'include')
-rw-r--r--include/mem_pool.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/mem_pool.h b/include/mem_pool.h
index 0665eac9c..cdd1f8d3b 100644
--- a/include/mem_pool.h
+++ b/include/mem_pool.h
@@ -37,9 +37,10 @@ class Pooling_Allocator : public Allocator
class Memory_Block
{
public:
- Memory_Block(void*, u32bit, u32bit);
+ Memory_Block(void*);
static u32bit bitmap_size() { return BITMAP_SIZE; }
+ static u32bit block_size() { return BLOCK_SIZE; }
bool contains(void*, u32bit) const throw();
byte* alloc(u32bit) throw();
@@ -51,12 +52,13 @@ class Pooling_Allocator : public Allocator
private:
typedef u64bit bitmap_type;
static const u32bit BITMAP_SIZE = 8 * sizeof(bitmap_type);
+ static const u32bit BLOCK_SIZE = 64;
+
bitmap_type bitmap;
byte* buffer, *buffer_end;
- u32bit block_size;
};
- const u32bit PREF_SIZE, BLOCK_SIZE;
+ const u32bit PREF_SIZE;
std::vector<Memory_Block> blocks;
std::vector<Memory_Block>::iterator last_used;