Reworked on mmap address alignments for a performance regression (#2057)

This commit is contained in:
Yang Liu 2024-11-22 19:06:55 +08:00 committed by GitHub
parent a39249454e
commit 52ba725fa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2994,10 +2994,9 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int f
new_flags&=~MAP_32BIT; // remove MAP_32BIT
if((flags&MAP_32BIT) && !(flags&MAP_FIXED)) {
// MAP_32BIT only exist on x86_64!
if(!(flags&MAP_FIXED) && (!old_addr || !isBlockFree(old_addr, length)))
addr = find31bitBlockNearHint(old_addr, length, 0);
addr = find31bitBlockNearHint(old_addr, length, 0);
} else if (box64_wine || 1) { // other mmap should be restricted to 47bits
if(!(flags&MAP_FIXED) && (!addr || !isBlockFree(addr, length)))
if (!(flags&MAP_FIXED) && !addr)
addr = find47bitBlock(length);
}
#endif