This is not an error. The changes of struct block* b = (struct block*)ptr - 1;
to struct block *b = (struct block *)((char *)ptr - BLOCK_SIZE);
adds more text to parse for the compiler and just looks ugly. Both do the same thing.
In my_custom_free
there's an error on line number 232 for the statement if (b == last)
. The last
global variable was not updated prior to that statement, which in turn the statement will…
In the find_best_fit
function on line number 111. There's a null pointer error. In the statement `if (!best_fit
There's an additional ALIGN16
macro function call in fragment_block
function which is unnecessary.
I noticed on line #34 there's an issue. You've done s += BLOCK_SIZE;
. This not ideal and should only hold the size of data the memory block contains, not including the memory block header.…
Seems a alignment of 16 bytes is indeed required of x64 architectures.