see ya later allocator
This commit is contained in:
parent
d7bc7e10ab
commit
aa53a4addb
44 changed files with 32 additions and 1693 deletions
|
|
@ -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--;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue