Fix heap delete to mark current as not in use, instead of prev
This commit is contained in:
parent
70cee81406
commit
f6b027c591
@ -75,7 +75,7 @@ void operator delete(void *ptr) {
|
|||||||
// ptr was found as a valid memory allocation, deallocate it
|
// ptr was found as a valid memory allocation, deallocate it
|
||||||
if (current) {
|
if (current) {
|
||||||
// mark as not in use
|
// mark as not in use
|
||||||
prev->inUse = false;
|
current->inUse = false;
|
||||||
|
|
||||||
// join with next if next is also unused
|
// join with next if next is also unused
|
||||||
if (current->next && !current->next->inUse) {
|
if (current->next && !current->next->inUse) {
|
||||||
|
Loading…
Reference in New Issue
Block a user