0022749: Segfault in HashCode() of Standard_Transient
[occt.git] / src / Standard / Standard_MMgrRaw.hxx
1 // File:        Standard_MMgrRaw.hxx
2 // Created:     Tue Mar 15 12:05:43 2005
3 // Author:      Peter KURNEV
4 //              <pkv@irinox>
5
6 #ifndef _Standard_MMgrRaw_HeaderFile
7 #define _Standard_MMgrRaw_HeaderFile
8
9 #ifndef _Standard_Address_HeaderFile
10 #include <Standard_Address.hxx>
11 #endif
12 #ifndef _Standard_Integer_HeaderFile
13 #include <Standard_Integer.hxx>
14 #endif
15 #ifndef _Standard_Macro_HeaderFile
16 #include <Standard_Macro.hxx>
17 #endif
18 #ifndef _Standard_MMgrRoot_HeaderFile
19 #include <Standard_MMgrRoot.hxx>
20 #endif
21
22 /**
23 * Implementation of raw OCC memory manager which uses standard C
24 * functions: malloc (or calloc), free and realloc 
25 * without any optimization
26 */
27
28 class Standard_MMgrRaw : public Standard_MMgrRoot
29 {
30  public:
31   //! Constructor; if aClear is True, the memory will be nullified
32   //! upon allocation.
33   Standard_EXPORT Standard_MMgrRaw(const Standard_Boolean aClear=Standard_False);
34
35   //! Allocate aSize bytes 
36   Standard_EXPORT virtual Standard_Address Allocate(const Standard_Size aSize);
37   
38   //! Reallocate aPtr to the size aSize. 
39   //! The pointer aPtr is nullified; new pointer is returned.
40   Standard_EXPORT virtual Standard_Address Reallocate(Standard_Address& aPtr, 
41                                                       const Standard_Size aSize);
42   
43   //! Free allocated memory. The pointer is nullified.
44   Standard_EXPORT virtual void Free(Standard_Address&);
45
46  protected:
47   Standard_Boolean myClear; //! Option to nullify allocated memory
48 };
49
50 #endif