mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
UserspaceEmulator: Convert backing storage from malloc to mmap
This saves a few bytes for each guest-mmaped region, especially since these are likely to be page-aligned.
This commit is contained in:
parent
968ad0f8d1
commit
7cc8f20a30
3 changed files with 28 additions and 16 deletions
|
@ -57,7 +57,7 @@ public:
|
|||
if (address.selector() == 0x2b)
|
||||
return m_tls_region.ptr();
|
||||
|
||||
size_t page_index = (address.offset() & ~(PAGE_SIZE - 1)) / PAGE_SIZE;
|
||||
size_t page_index = address.offset() / PAGE_SIZE;
|
||||
return m_page_to_region_map[page_index];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue