gwnavruntime/kernel/HeapPT/HeapPT_SysAllocMalloc.h Source File

HeapPT_SysAllocMalloc.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 /**************************************************************************
8 
9 PublicHeader: Kernel
10 Filename : HeapPT_SysAllocMalloc.h
11 Content : Malloc System Allocator
12 Created : 2009
13 Authors : Maxim Shemanarev
14 
15 Notes : System Allocator that uses regular malloc/free
16 
17 **************************************************************************/
18 
19 #ifndef INC_KY_Kernel_SysAllocMalloc_H
20 #define INC_KY_Kernel_SysAllocMalloc_H
21 
23 
24 namespace Kaim {
25 
26 // ***** SysAllocPagedMalloc
27 //
28 //------------------------------------------------------------------------
29 class SysAllocPagedMalloc : public SysAllocBase_SingletonSupport<SysAllocPagedMalloc, SysAllocPaged>
30 {
31 public:
32  enum { MinGranularity = 64*1024 };
33 
34  KY_EXPORT SysAllocPagedMalloc(UPInt granularity = MinGranularity);
35 
36  virtual void GetInfo(Info* i) const;
37  virtual void* Alloc(UPInt size, UPInt align);
38  virtual bool Free(void* ptr, UPInt size, UPInt align);
39 
40  virtual UPInt GetFootprint() const { return Footprint; }
41  virtual UPInt GetUsedSpace() const { return Footprint; }
42 
43  virtual UPInt GetBase() const; // DBG
44 
45 private:
46  UPInt Granularity;
47  UPInt Footprint;
48  UPInt Base; // DBG
49 };
50 
51 } // Scaleform
52 
53 #endif
Definition: gamekitcrowddispersion.h:20