From 69eb3090310dd8e3740e41ba184dc7cf6efbf4c9 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 14 Feb 2023 10:58:58 +0100 Subject: [DYNAREC] Fixed an issue with custom memory alocator --- src/custommem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/custommem.c b/src/custommem.c index a88674fd..9f5422a9 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -433,7 +433,7 @@ mmapchunk_t* addChunk(size_t mmapsize) { mmaplist = (mmaplist_t*)box_calloc(1, sizeof(mmaplist_t)); mmaplist_t* head = mmaplist; size_t i = mmapsize; - while(i) { + while(1) { if(i>=NCHUNK) { i-=NCHUNK; if(!head->next) { @@ -443,7 +443,6 @@ mmapchunk_t* addChunk(size_t mmapsize) { } else return &head->chunks[i]; } - return NULL; // never reached } uintptr_t FindFreeDynarecMap(dynablock_t* db, size_t size) -- cgit 1.4.1