#ifndef __cxz_allocator__ #define __cxz_allocator__ #include #include #include #include #include #include #include "base/types.h" #include "base/intrin.h" #define MIB_SIZE 1024*1024 // 1MiB #define WARN_SIZE MIB_SIZE*100 // 100 MiB namespace CNORXZ { template class Allocator { public: typedef T value_type; static constexpr SizeT type_size = sizeof(T); static constexpr SizeT N = MAX_VSIZE; struct VX { alignas(N) char x[N]; }; Allocator() = default; template Allocator(const Allocator& x) {} T* allocate(SizeT n); void deallocate(T* p, SizeT n); }; template bool operator==(const Allocator& a, const Allocator& b); template bool operator!=(const Allocator& a, const Allocator& b); } // namespace CNORXZ #endif