// -*- C++ -*- #ifndef HL_ONEHEAP_H #define HL_ONEHEAP_H #include "utility/singleton.h" namespace HL { template class OneHeap : public singleton { public: enum { Alignment = TheHeap::Alignment }; static inline void * malloc (size_t sz) { return singleton::getInstance().malloc (sz); } // 'auto' because some free() return bool, others void static inline auto free (void * ptr) { return singleton::getInstance().free (ptr); } static inline size_t getSize (void * ptr) { return singleton::getInstance().getSize (ptr); } static inline void * memalign (size_t alignment, size_t sz) { return singleton::getInstance().memalign(alignment, sz); } }; } #endif