annotate Allocator.h @ 146:1b7ca63e472e

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