diff options
| author | rajdakin <rajdakin@gmail.com> | 2023-12-31 15:49:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-31 15:49:57 +0100 |
| commit | 5e9e1faedc97194e46f3fb4b3665ec416ce7efbf (patch) | |
| tree | 27d345328502d82ede6c58e3d181d1f682bab255 /src/wrapped/wrappedlibc.c | |
| parent | dba6a88341bacbf52d0f0c37117a04164afce9fa (diff) | |
| download | box64-5e9e1faedc97194e46f3fb4b3665ec416ce7efbf.tar.gz box64-5e9e1faedc97194e46f3fb4b3665ec416ce7efbf.zip | |
[MEMORY] Switched from a sparse array to a red-black tree (#1180)
* [MEMORY] Switched from a sparse array to an RB tree * [RBTREE] Fixed the Android build
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
| -rw-r--r-- | src/wrapped/wrappedlibc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 9dbd6e04..3f54350c 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -2645,9 +2645,9 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot #endif if(ret!=MAP_FAILED) { if(emu) - setProtection_mmap((uintptr_t)ret, length, prot); + setProtection_mmap((uintptr_t)ret, length, (uint8_t)prot); else - setProtection((uintptr_t)ret, length, prot); + setProtection((uintptr_t)ret, length, (uint8_t)prot); } return ret; } @@ -2660,7 +2660,7 @@ EXPORT void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t ne void* ret = mremap(old_addr, old_size, new_size, flags, new_addr); if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "%p\n", ret);} if(ret!=(void*)-1) { - uint32_t prot = getProtection((uintptr_t)old_addr)&~PROT_CUSTOM; + uint8_t prot = getProtection((uintptr_t)old_addr)&~PROT_CUSTOM; if(ret==old_addr) { if(old_size && old_size<new_size) { setProtection_mmap((uintptr_t)ret+old_size, new_size-old_size, prot); @@ -2736,11 +2736,11 @@ EXPORT int my_mprotect(x64emu_t* emu, void *addr, unsigned long len, int prot) #endif if(!ret && len) { if(prot) - updateProtection((uintptr_t)addr, len, prot); + updateProtection((uintptr_t)addr, len, (uint8_t)prot); else { // avoid allocating detailled protection for a no prot 0 freeProtection((uintptr_t)addr, len); - setProtection_mmap((uintptr_t)addr, len, prot); + setProtection_mmap((uintptr_t)addr, len, (uint8_t)prot); } } return ret; |