From 59b0da15168647cb91efd5ff11f0b5af6739148d Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 10 Feb 2017 00:19:37 -0500 Subject: research/heap.txt: Improve malloc() code --- diff --git a/research/heap.txt b/research/heap.txt index 4ec78f1..53b6250 100644 --- a/research/heap.txt +++ b/research/heap.txt @@ -20,11 +20,11 @@ Functions return ++heap->top else block = heap->free_head - if heap->free_head->next_free set - heap->free_head = heap->free_head->next_free - else + if heap->free_head == heap->free_tail unset heap->free_head unset heap->free_tail + else + heap->free_head = heap->free_head->next_free return block free(heap, ptr) if heap->free_tail unset -- cgit v0.9.1