diff Allocator.h @ 0:9c0607679772

init
author Ritor1
date Sat, 12 Jan 2013 09:45:18 +0600
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Allocator.h	Sat Jan 12 09:45:18 2013 +0600
@@ -0,0 +1,31 @@
+#pragma once
+
+
+#pragma pack(push, 1)
+struct Allocator
+{
+  static Allocator *Create() {static Allocator a; return &a;}
+
+  Allocator();
+  bool  Initialize(unsigned int uNumKBytes);
+  void *AllocNamedChunk(const void *pPrevPtrValue, unsigned int uSize, const char *pName);
+  void FreeChunk(void *ptr);
+  bool CreateFileDump(const char *a1);
+
+  void *pMemoryBuffers[6000];
+  unsigned int uMemoryBuffersSizes[6000];
+  char pMemoryBuffersNames[6000][12];
+  unsigned int uDumpsCount;
+  unsigned int uNumBuffersUsed;
+  void *pBigMemoryBuffer;
+  unsigned int uNextFreeOffsetInBigBuffer;
+  unsigned int uBigBufferSizeAligned;
+  unsigned int bBigBufferAllocated;
+  unsigned int bUseBigBuffer;
+  void *pBigBufferAligned;
+};
+#pragma pack(pop)
+
+
+
+extern Allocator *pAllocator; // idb
\ No newline at end of file