Malloc/free issues

As a side note

The code is possibly wrong because it performs pointer arithmetic beyond the allocated memory (c1 + RequestedSize + 8), which is undefined behavior in C++. Once in UB territory all bets are off.

Also casting that pointer to int risks truncation or sign errors on a 32-bit system, making the comparison with SDRAM_END_ADDRESS likely invalid.