#ifndef LLARP_MEM_HPP #define LLARP_MEM_HPP #include #include namespace llarp { template static constexpr size_t alignment() { return std::exp2(1 + std::floor(std::log2(sizeof(T)))); } template static T * Alloc(llarp_alloc * mem=&llarp_g_mem) { return static_cast( mem->alloc(sizeof(T), alignment())); } } // namespace llarp #endif