blob: 49f012d8575f303c30b8b2c75c2ef387f0655482 (
plain) (
tree)
|
|
#include "alloc.h"
#include <util/generic/singleton.h>
#include <util/system/sys_alloc.h>
using TBlock = TDefaultAllocator::TBlock;
TBlock TDefaultAllocator::Allocate(size_t len) {
TBlock ret = {y_allocate(len), len};
return ret;
}
void TDefaultAllocator::Release(const TBlock& block) {
y_deallocate(block.Data);
}
IAllocator* TDefaultAllocator::Instance() noexcept {
return SingletonWithPriority<TDefaultAllocator, 0>();
}
|