gwnavruntime/kernel/HeapMH/HeapMH_AllocBitSet2.h Source File

HeapMH_AllocBitSet2.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 Filename : HeapMH_AllocBitSet2.h
10 Content : "Magic-header based" Bit-set based allocator, 2 bits
11  per block.
12 
13 Created : 2009
14 Authors : Maxim Shemanarev
15 
16 **************************************************************************/
17 
18 #ifndef INC_KY_Kernel_HeapMH_AllocBitSet2_H
19 #define INC_KY_Kernel_HeapMH_AllocBitSet2_H
20 
23 
24 namespace Kaim { namespace HeapMH {
25 
26 //------------------------------------------------------------------------
27 class AllocBitSet2MH
28 {
29 public:
30  AllocBitSet2MH();
31 
32  void Reset() { Bin.Reset(); }
33 
34  void InitPage(PageMH* page, UInt32 index);
35  void ReleasePage(UByte* start);
36 
37  void* Alloc(UPInt size, MagicHeadersInfo* headers);
38  void* Alloc(UPInt size, UPInt alignSize, MagicHeadersInfo* headers);
39  void* ReallocInPlace(PageMH* page, void* oldPtr, UPInt newSize, UPInt* oldSize, MagicHeadersInfo* headers);
40  void Free(PageMH* page, void* ptr, MagicHeadersInfo* headers, UPInt* oldBytes);
41 
42  UPInt GetUsableSize(const PageMH* page, const void* ptr) const;
43 
44 private:
45  ListBinMH Bin;
46 };
47 
48 }} // Kaim::HeapMH
49 
50 
51 #endif
Definition: gamekitcrowddispersion.h:20