From cd8066757b5c0a8d9a9090e0019a5a0cb9a59829 Mon Sep 17 00:00:00 2001 From: lax1dude Date: Fri, 1 Nov 2024 17:49:21 -0700 Subject: [PATCH] fix hugeAlloc --- core/src/main/java/org/teavm/runtime/LaxMalloc.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/teavm/runtime/LaxMalloc.java b/core/src/main/java/org/teavm/runtime/LaxMalloc.java index f7f5c30b7..088f4e9f4 100644 --- a/core/src/main/java/org/teavm/runtime/LaxMalloc.java +++ b/core/src/main/java/org/teavm/runtime/LaxMalloc.java @@ -241,7 +241,7 @@ public final class LaxMalloc { // iterate all free huge chunks Address addrIterator = chunkPtr; - while((addrIterator = readChunkNextFreeAddr(addrIterator)).getInt() != chunkPtr.getInt()) { + do { int chunkSize = readChunkSize(addrIterator); if(chunkSize - 8 >= sizeBytes) { // size - 2 ints @@ -259,7 +259,7 @@ public final class LaxMalloc { return ret; } - } + }while((addrIterator = readChunkNextFreeAddr(addrIterator)).getInt() != chunkPtr.getInt()); } // no free huge chunks found, time to sbrk