Fix k_free

This commit is contained in:
Baptiste Wicht 2013-11-02 23:28:31 +01:00
parent ba67012d0b
commit c5afd61093

View File

@ -201,7 +201,10 @@ std::size_t* k_malloc(std::size_t bytes){
}
void k_free(std::size_t* block){
auto free_header = reinterpret_cast<malloc_header_chunk*>(block);
auto free_header = reinterpret_cast<malloc_header_chunk*>(
reinterpret_cast<uintptr_t>(block) - sizeof(malloc_header_chunk));
_used_memory -= free_header->size + META_SIZE;
auto header = malloc_head;