| 1 | // -*- C++ -*-cxx . . $ `<file>/vendor/Heap-Layers/heaps/utility/oneheap.h`/ |
| 2 | |
| 3 | #ifndef HL_ONEHEAP_H |
| 4 | #define HL_ONEHEAP_Hcxx . . $ `vendor/Heap-Layers/heaps/utility/oneheap.h:4:9`! |
| 5 | |
| 6 | #include "utility/singleton.h"cxx . . $ `<file>/vendor/Heap-Layers/utility/singleton.h`/ |
| 7 | |
| 8 | namespace HLcxx . . $ HL/ { |
| 9 | |
| 10 | template <class TheHeap> |
| 11 | class OneHeapcxx . . $ HL/OneHeap# : public singletoncxx . . $ HL/singleton#<TheHeap> { |
| 12 | public: |
| 13 | |
| 14 | enumcxx . . $ HL/OneHeap#$anonymous_type_0# { Alignmentcxx . . $ HL/OneHeap#Alignment. = TheHeap::Alignment }; |
| 15 | |
| 16 | static inline void * malloccxx . . $ HL/OneHeap#malloc(bfcfa4d6b7f7ef64). (size_t sz) { |
| 17 | return singletoncxx . . $ HL/singleton#<TheHeap>::getInstance().malloc (sz); |
| 18 | } |
| 19 | |
| 20 | // 'auto' because some free() return bool, others void |
| 21 | static inline auto freecxx . . $ HL/OneHeap#free(b60bee3bf464f7e8). (void * ptr) { |
| 22 | return singletoncxx . . $ HL/singleton#<TheHeap>::getInstance().free (ptr); |
| 23 | } |
| 24 | |
| 25 | static inline size_t getSizecxx . . $ HL/OneHeap#getSize(751e5d26f8574c32). (void * ptr) { |
| 26 | return singletoncxx . . $ HL/singleton#<TheHeap>::getInstance().getSize (ptr); |
| 27 | } |
| 28 | |
| 29 | static inline void * memaligncxx . . $ HL/OneHeap#memalign(63a7bf2941bfcd7a). (size_t alignment, size_t sz) { |
| 30 | return singletoncxx . . $ HL/singleton#<TheHeap>::getInstance().memalign(alignment, sz); |
| 31 | } |
| 32 | }; |
| 33 | |
| 34 | } |
| 35 | |
| 36 | #endif |