diff options
| author | Jonas Ask | 2009-11-22 20:34:25 +0000 |
|---|---|---|
| committer | Jonas Ask | 2009-11-22 20:34:25 +0000 |
| commit | e6af6f34da302b7f4cc83a6a9affff5b4bdda845 (patch) | |
| tree | 29d132d4948a6632f181f475e2c8b1a65d29712f /BlockFactory.h | |
| parent | 3b8c43aee92898159672807bc759317aefdb208b (diff) | |
| download | stonesense-e6af6f34da302b7f4cc83a6a9affff5b4bdda845.tar.gz stonesense-e6af6f34da302b7f4cc83a6a9affff5b4bdda845.tar.bz2 stonesense-e6af6f34da302b7f4cc83a6a9affff5b4bdda845.tar.xz | |
Block allocation is now handled by a BlockFactor singleton. This saves A LOT of New/Deletes.
Diffstat (limited to 'BlockFactory.h')
| -rw-r--r-- | BlockFactory.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/BlockFactory.h b/BlockFactory.h new file mode 100644 index 0000000..a122dd6 --- /dev/null +++ b/BlockFactory.h @@ -0,0 +1,20 @@ +#pragma once
+
+#include "Block.h"
+
+class BlockFactory
+{
+ uint32_t poolSize;
+ vector<Block*> pool;
+
+public:
+ BlockFactory(void);
+ ~BlockFactory(void);
+ Block* allocateBlock( );
+ void deleteBlock( Block* );
+ uint32_t getPoolSize(){ return poolSize; }
+};
+
+
+
+extern BlockFactory blockFactory;
\ No newline at end of file |
