see ya later allocator

This commit is contained in:
IlyaShurupov 2024-03-22 14:05:03 +03:00
parent d7bc7e10ab
commit aa53a4addb
44 changed files with 32 additions and 1693 deletions

View file

@ -4,8 +4,6 @@
#include "primitives/nullobject.h"
#include "HeapAllocatorGlobal.hpp"
#include <malloc.h>
namespace obj {
@ -26,7 +24,7 @@ namespace obj {
};
Object* ObjectMemAllocate(const ObjectType* type) {
ObjectMemHead* memh = (ObjectMemHead*) tp::HeapAllocGlobal::allocate(type->size + sizeof(ObjectMemHead));
ObjectMemHead* memh = (ObjectMemHead*) malloc(type->size + sizeof(ObjectMemHead));
if (!memh) {
return NULL;
}
@ -62,7 +60,7 @@ namespace obj {
bottom = memh->up;
}
tp::HeapAllocGlobal::deallocate(memh);
free(memh);
count--;
}