summaryrefslogtreecommitdiff
path: root/src/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem.c')
-rw-r--r--src/mem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mem.c b/src/mem.c
index 8099b6bb7e..c03c8b3452 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -489,6 +489,12 @@ void *rt_realloc(void *rmem, rt_size_t newsize)
{
((struct heap_mem *)&heap_ptr[mem2->next])->prev = ptr2;
}
+
+ if (mem2 < lfree)
+ {
+ /* the splited struct is now the lowest */
+ lfree = mem2;
+ }
plug_holes(mem2);