From 42786f775eac016a383a266dca233cb952e3f912 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Sat, 14 Sep 2024 07:45:52 +0100 Subject: [PATCH] Fix a bug in the allocator# --- GL/alloc/alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GL/alloc/alloc.c b/GL/alloc/alloc.c index 6760ff4..cde5588 100644 --- a/GL/alloc/alloc.c +++ b/GL/alloc/alloc.c @@ -456,7 +456,7 @@ void alloc_run_defrag(void* pool, defrag_address_move callback, int max_iteratio while(it) { void* potential_dest = alloc_next_available(pool, it->size); - if(potential_dest < it->pointer) { + if(potential_dest && potential_dest < it->pointer) { potential_dest = alloc_malloc(pool, it->size); memcpy(potential_dest, it->pointer, it->size);