view Allocator.h @ 652:1ff57450f090

* Some fixes to TravelByTransport * Minor bug with npc profession names * Fixed not loading npc profession decriptions * NPC professions enum
author Nomad
date Tue, 12 Mar 2013 04:45:38 +0200
parents 9c0607679772
children
line wrap: on
line source

#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