mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-19 09:35:15 -04:00
Fix k_free
This commit is contained in:
parent
ba67012d0b
commit
c5afd61093
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user