Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:18

0001 // Created on: 2009-12-30
0002 // Created by: Alexander GRIGORIEV
0003 // Copyright (c) 2009-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef NCollection_HeapAllocator_HeaderFile
0017 #define NCollection_HeapAllocator_HeaderFile
0018 
0019 #include <NCollection_BaseAllocator.hxx>
0020 
0021 
0022 /**
0023  * Allocator that uses the global dynamic heap (malloc / free). 
0024  */
0025 
0026 class NCollection_HeapAllocator : public NCollection_BaseAllocator
0027 {
0028  public:
0029   // ---------- PUBLIC METHODS ----------
0030   Standard_EXPORT virtual void* Allocate (const Standard_Size theSize) Standard_OVERRIDE;
0031   void* AllocateOptimal(const Standard_Size theSize) Standard_OVERRIDE { return Allocate(theSize); }
0032   Standard_EXPORT virtual void  Free     (void * anAddress) Standard_OVERRIDE;
0033 
0034   Standard_EXPORT static const Handle(NCollection_HeapAllocator)&
0035                                 GlobalHeapAllocator();
0036 
0037  protected:
0038   //! Constructor - prohibited
0039   NCollection_HeapAllocator(void) {}
0040 
0041  private:
0042   //! Copy constructor - prohibited
0043   NCollection_HeapAllocator(const NCollection_HeapAllocator&);
0044 
0045  public:
0046 // Declaration of CASCADE RTTI
0047 DEFINE_STANDARD_RTTIEXT(NCollection_HeapAllocator,NCollection_BaseAllocator)
0048 };
0049 
0050 // Definition of HANDLE object using Standard_DefineHandle.hxx
0051 DEFINE_STANDARD_HANDLE (NCollection_HeapAllocator, NCollection_BaseAllocator)
0052 
0053 #endif