mirror of
https://github.com/ptitSeb/box86.git
synced 2024-11-27 08:50:28 +00:00
[ELFLOADER] Last improvment to elfloader memory managment, should be good now
This commit is contained in:
parent
3f12bde9ff
commit
08d8407056
@ -1121,7 +1121,7 @@ static void* findBlockHinted(void* hint, size_t size)
|
||||
if(addr<=h && end>=h && end-h+1>=size)
|
||||
return hint;
|
||||
uintptr_t aaddr = (addr+0xffff)&~0xffff;
|
||||
if(addr<=aaddr && end>aaddr && end-aaddr+1>=size)
|
||||
if(aaddr>=h && end>aaddr && end-aaddr+1>=size)
|
||||
return (void*)aaddr;
|
||||
if(end>=0xc0000000 && h<0xc0000000)
|
||||
return NULL;
|
||||
|
@ -266,6 +266,7 @@ int AllocLoadElfMemory(box86context_t* context, elfheader_t* head, int mainbin)
|
||||
return 1;
|
||||
}
|
||||
setProtection_mmap((uintptr_t)p, head->multiblocks[n].asize, prot);
|
||||
head->multiblocks[n].p = p;
|
||||
if(e->p_filesz) {
|
||||
fseeko64(head->file, head->multiblocks[n].offs, SEEK_SET);
|
||||
if(fread((void*)head->multiblocks[n].paddr, head->multiblocks[n].size, 1, head->file)!=1) {
|
||||
|
Loading…
Reference in New Issue
Block a user