comparison Allocator.h @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8b8875f5b359
1 #pragma once
2
3
4 #pragma pack(push, 1)
5 struct Allocator
6 {
7 static Allocator *Create() {static Allocator a; return &a;}
8
9 Allocator();
10 bool Initialize(unsigned int uNumKBytes);
11 void *AllocNamedChunk(const void *pPrevPtrValue, unsigned int uSize, const char *pName);
12 void FreeChunk(void *ptr);
13 bool CreateFileDump(const char *a1);
14
15 void *pMemoryBuffers[6000];
16 unsigned int uMemoryBuffersSizes[6000];
17 char pMemoryBuffersNames[6000][12];
18 unsigned int uDumpsCount;
19 unsigned int uNumBuffersUsed;
20 void *pBigMemoryBuffer;
21 unsigned int uNextFreeOffsetInBigBuffer;
22 unsigned int uBigBufferSizeAligned;
23 unsigned int bBigBufferAllocated;
24 unsigned int bUseBigBuffer;
25 void *pBigBufferAligned;
26 };
27 #pragma pack(pop)
28
29
30
31 extern Allocator *pAllocator; // idb