This is a memory allocator with a runtime complexity of O(log N)
.
Basically I move the brk address or break address 8 kilo bytes upper, using the sys_brk
call, to create an array where I use it to create heap, with that implementation I accomplish a runtime of o(logn)
when free
function gets executed.
And when ges execute alloc
checks if there is a chuck with enough memory to use it, so if there is well it is going to take that chuck divided into two new chucks and return the chuck with the memory that you need and the another one will be pushed into the heap, doing a runtime again of O(logn)
.
Blah balh Almost done >:)
Blah blah Almost done >:)