mirror of
https://github.com/ptitSeb/box86.git
synced 2026-11-10 04:01:32 -10:00
Fixed a small issue with Custom Mem handler and MexFreeBlock calculation
This commit is contained in:
1 parent
337d08d466
commit
5b3eb577fc
1 file changed
+3
-1
+3
-1
@@ -92,7 +92,9 @@ static int getMaxFreeBlock(void* block, size_t block_size)
|
||||
int maxsize = 0;
|
||||
while(m->prev.x32) { // while there is a subblock
|
||||
if(!m->prev.fill && m->prev.size>maxsize) {
|
||||
maxsize = m->prev.size-sizeof(blockmark_t); // remove the marker
|
||||
maxsize = m->prev.size;
|
||||
if(maxsize>sizeof(blockmark_t)) // remove the marker
|
||||
maxsize -= sizeof(blockmark_t);
|
||||
if((uintptr_t)block+maxsize>(uintptr_t)m)
|
||||
return maxsize; // no block large enough left...
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user