annotate Allocator.h @ 767:45615cacad31

Fog fixed
author Nomad
date Sat, 23 Mar 2013 21:11:15 +0200
parents 9c0607679772
children
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
5 struct Allocator
Ritor1
parents:
diff changeset
6 {
Ritor1
parents:
diff changeset
7 static Allocator *Create() {static Allocator a; return &a;}
Ritor1
parents:
diff changeset
8
Ritor1
parents:
diff changeset
9 Allocator();
Ritor1
parents:
diff changeset
10 bool Initialize(unsigned int uNumKBytes);
Ritor1
parents:
diff changeset
11 void *AllocNamedChunk(const void *pPrevPtrValue, unsigned int uSize, const char *pName);
Ritor1
parents:
diff changeset
12 void FreeChunk(void *ptr);
Ritor1
parents:
diff changeset
13 bool CreateFileDump(const char *a1);
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15 void *pMemoryBuffers[6000];
Ritor1
parents:
diff changeset
16 unsigned int uMemoryBuffersSizes[6000];
Ritor1
parents:
diff changeset
17 char pMemoryBuffersNames[6000][12];
Ritor1
parents:
diff changeset
18 unsigned int uDumpsCount;
Ritor1
parents:
diff changeset
19 unsigned int uNumBuffersUsed;
Ritor1
parents:
diff changeset
20 void *pBigMemoryBuffer;
Ritor1
parents:
diff changeset
21 unsigned int uNextFreeOffsetInBigBuffer;
Ritor1
parents:
diff changeset
22 unsigned int uBigBufferSizeAligned;
Ritor1
parents:
diff changeset
23 unsigned int bBigBufferAllocated;
Ritor1
parents:
diff changeset
24 unsigned int bUseBigBuffer;
Ritor1
parents:
diff changeset
25 void *pBigBufferAligned;
Ritor1
parents:
diff changeset
26 };
Ritor1
parents:
diff changeset
27 #pragma pack(pop)
Ritor1
parents:
diff changeset
28
Ritor1
parents:
diff changeset
29
Ritor1
parents:
diff changeset
30
Ritor1
parents:
diff changeset
31 extern Allocator *pAllocator; // idb