9 #ifndef BHEAP_MEMORY_HPP
10 #define BHEAP_MEMORY_HPP
18 typedef unsigned char byte;
20 #define MEM_ALIGNMENT 32
154 static_cast<HeapMemory *
>(
this)->
operator=(mem);
169 static_cast<HeapMemory *
>(
this)->
operator=(mem);
193 size_t buf_sz_t = mem.
buf_sz;
void swap(HeapMemory &mem)
Swap the memory.
BHeapMemory(const BHeapMemory &mem)
Copy the Heap memory.
BHeapMemory(BHeapMemory &&mem) noexcept
Copy the Heap memory.
virtual bool allocate(size_t sz)
allocate memory
virtual bool allocate(size_t sz)
allocate the memory
virtual ~BHeapMemory() noexcept
Destructor.
BHeapMemory & operator=(BHeapMemory &&mem)
Copy the memory.
virtual size_t size() const
Resize the buffer size.
virtual size_t size() const
the the size of the allocated memory
This class allocate, and destroy CPU memory.
It is like HeapMemory but buffered.
size_t buf_sz
size of the memory
virtual void destroy()
destroy memory
BHeapMemory & operator=(const BHeapMemory &mem)
Copy the memory.
size_t msize()
Return the memory size.
void swap(BHeapMemory &mem)
swap the two mwmory object
virtual bool resize(size_t sz)
Resize the allocated memory.
virtual bool resize(size_t sz)
resize the memory allocated
BHeapMemory()
Constructor, we choose a default alignment of 32 for avx.
void destroy()
Destroy the internal memory.
size_t sz
Size of the memory.