Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ These don't matter except for other assembly patches

## Improvements

- Allows to use 4GB on x64
- Complete HEAPMNG page-map coverage and enable free-region coalescing across the 3-4 GiB range on x64.

- hooks/HFix4GB.cpp

Expand Down
11 changes: 9 additions & 2 deletions hooks/HFix4GB.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
asm(
// Allocate one 4-byte map entry for every 4 KiB page in the complete
// 32-bit virtual address space: 0x100000 entries * 4 = 0x400000 bytes.
".section h0; .set h0,0x957E35;"
"PUSH 0x3FF000;"
"PUSH 0x400000;"

".section h1; .set h1,0x915A92;"
"ADD EAX,EAX;"
Expand All @@ -11,4 +13,9 @@ asm(

".section h2; .set h2,0x915B05;"
"JMP .-0x73;"
);

// Keep 0x100000 as the one-past-end page index while allowing free
// regions in the 3-4 GiB range to coalesce with a right neighbour.
".section h3; .set h3,0x958107;"
"CMP EAX,0x100000;"
);