ODIN
tjheap.h
1 /***************************************************************************
2  tjheap.h - description
3  -------------------
4  begin : Thu Jul 31 2003
5  copyright : (C) 2000-2021 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef TJHEAP_H
19 #define TJHEAP_H
20 
21 #ifndef TJUTILS_CONFIG_H
22 #define TJUTILS_CONFIG_H
23 #include <tjutils/config.h>
24 #endif
25 
26 // pointer for external trace function
27 typedef void (*heaptracefunction)(const char*);
28 
29 
30 class Heap {
31  public:
32  static void malloc_stats();
33  static void set_trace_function(heaptracefunction func) {tracefunc=func;}
34 
35  static heaptracefunction tracefunc;
36 };
37 
38 
39 //#ifdef CUSTOM_HEAP
40 
41 //#include <tjutils/tjcstd.h>
42 
43 //#ifndef STL_REPLACEMENT
44 //#include <new>
45 //#endif
46 
47 
48 // overloading new/delete if a custom heap (block of static memory) is used
49 
50 //#ifndef STL_REPLACEMENT
51 //void* operator new(size_t size) throw (std::bad_alloc);
52 //#else
53 //void* operator new(size_t size);
54 //#endif
55 //void* operator new[](size_t size);
56 
57 //void operator delete(void* mptr);
58 //void operator delete[](void* mptr);
59 
60 //#endif
61 
62 
63 #endif