Debian Codegraph @

vendor/Heap-Layers/heaps/utility/oneheap.h

raw symbols SCIP
1 // -*- C++ -*-
2
3 #ifndef HL_ONEHEAP_H
4 #define HL_ONEHEAP_H
5
6 #include "utility/singleton.h"
7
8 namespace HL {
9
10 template <class TheHeap>
11 class OneHeap : public singleton<TheHeap> {
12 public:
13
14 enum { Alignment = TheHeap::Alignment };
15
16 static inline void * malloc (size_t sz) {
17 return singleton<TheHeap>::getInstance().malloc (sz);
18 }
19
20 // 'auto' because some free() return bool, others void
21 static inline auto free (void * ptr) {
22 return singleton<TheHeap>::getInstance().free (ptr);
23 }
24
25 static inline size_t getSize (void * ptr) {
26 return singleton<TheHeap>::getInstance().getSize (ptr);
27 }
28
29 static inline void * memalign (size_t alignment, size_t sz) {
30 return singleton<TheHeap>::getInstance().memalign(alignment, sz);
31 }
32 };
33
34 }
35
36 #endif