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 under
8 // the terms of the GNU Lesser General Public License 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>
23 * Allocator that uses the global dynamic heap (malloc / free).
26 class NCollection_HeapAllocator : public NCollection_BaseAllocator
29 // ---------- PUBLIC METHODS ----------
30 Standard_EXPORT virtual void* Allocate (const Standard_Size theSize) Standard_OVERRIDE;
31 Standard_EXPORT virtual void Free (void * anAddress) Standard_OVERRIDE;
33 Standard_EXPORT static const Handle(NCollection_HeapAllocator)&
34 GlobalHeapAllocator();
37 //! Constructor - prohibited
38 NCollection_HeapAllocator(void) {}
41 //! Copy constructor - prohibited
42 NCollection_HeapAllocator(const NCollection_HeapAllocator&);
45 // Declaration of CASCADE RTTI
46 DEFINE_STANDARD_RTTIEXT(NCollection_HeapAllocator,NCollection_BaseAllocator)
49 // Definition of HANDLE object using Standard_DefineHandle.hxx
50 DEFINE_STANDARD_HANDLE (NCollection_HeapAllocator, NCollection_BaseAllocator)