gwnavruntime/kernel/HeapMH/HeapMH_SysAllocMalloc.h Source File

HeapMH_SysAllocMalloc.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 : HeapMH_SysAllocMalloc.h
11 Content : System Allocator Interface
12 Created : 2009
13 Authors : Maxim Shemanarev
14 
15 Notes : Interface to the system allocator.
16 
17 **************************************************************************/
18 
19 #pragma once
20 
22 #include "gwnavruntime/basesystem/systemalloc.h" // yeah I known, Kernel now depends on basesystem, SystemAlloc could be in Kernel
23 
24 namespace Kaim {
25 
26 class SysAllocMalloc : public SysAllocBase_SingletonSupport<SysAllocMalloc, SysAlloc>
27 {
28 public:
29  SysAllocMalloc() {}
30  virtual ~SysAllocMalloc() {}
31  virtual void* Alloc(UPInt size, UPInt align) { return Kaim::PageAlloc::Alloc(size, align); }
32  virtual void Free(void* ptr, UPInt size, UPInt align) { Kaim::PageAlloc::Free(ptr, size, align); }
33  virtual void* Realloc(void* oldPtr, UPInt oldSize, UPInt newSize, UPInt align) { return Kaim::PageAlloc::Realloc(oldPtr, oldSize, newSize, align); }
34 };
35 
36 
37 } // Scaleform
38 
virtual void Free(void *ptr, UPInt size, UPInt align)
Frees the specified memory buffer.
Definition: HeapMH_SysAllocMalloc.h:32
virtual void * Alloc(UPInt size, UPInt align)
Allocates a buffer of the specified size, with the specified alignment.
Definition: HeapMH_SysAllocMalloc.h:31
This implementation of SysAlloc is used by default by the BaseSystem to allocate and free memory...
Definition: HeapMH_SysAllocMalloc.h:26
Adds to the SysAlloc class support for restricting instantiation to a single object.
Definition: SF_SysAlloc.h:80
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
virtual void * Realloc(void *oldPtr, UPInt oldSize, UPInt newSize, UPInt align)
Re-allocates a buffer to a new size.
Definition: HeapMH_SysAllocMalloc.h:33