1 // Created on: 2009-12-30
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2009-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and / or modify it
8 // under the terms of the GNU Lesser General Public version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef NCollection_HeapAllocator_HeaderFile
17 #define NCollection_HeapAllocator_HeaderFile
19 #include <NCollection_BaseAllocator.hxx>
21 class Handle_NCollection_HeapAllocator;
24 * Allocator that uses the global dynamic heap (malloc / free).
27 class NCollection_HeapAllocator : public NCollection_BaseAllocator
30 // ---------- PUBLIC METHODS ----------
31 Standard_EXPORT virtual void* Allocate (const Standard_Size theSize);
32 Standard_EXPORT virtual void Free (void * anAddress);
34 Standard_EXPORT static const Handle_NCollection_HeapAllocator&
35 GlobalHeapAllocator();
38 //! Constructor - prohibited
39 NCollection_HeapAllocator(void) {};
42 //! Copy constructor - prohibited
43 NCollection_HeapAllocator(const NCollection_HeapAllocator&);
46 // Declaration of CASCADE RTTI
47 DEFINE_STANDARD_RTTI (NCollection_HeapAllocator)
50 // Definition of HANDLE object using Standard_DefineHandle.hxx
51 DEFINE_STANDARD_HANDLE (NCollection_HeapAllocator, NCollection_BaseAllocator)