diff options
Diffstat (limited to 'results/scraper/box64/2546')
| -rw-r--r-- | results/scraper/box64/2546 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/results/scraper/box64/2546 b/results/scraper/box64/2546 new file mode 100644 index 000000000..437acd40a --- /dev/null +++ b/results/scraper/box64/2546 @@ -0,0 +1,37 @@ +Proposal to Merge `mmapmem` into `mapallmem`: Need Clarification on `data == 2` +I'm planning to merge `mmapmem` into `mapallmem` (see [commit 93ebb0c](https://github.com/devarajabc/box64/commit/93ebb0c58a434bb6c0f39503b88a8b9ee4047139)), by using the `data` field to indicate whether a memory fragment is allocated via `mmap`. Since all memory mapped in `mmapmem` is also mapped in `mapallmem`, maintaining both trees may cause memory redundancy. + +In the proposed scheme: + +- `data == 1`: Memory fragment is allocated. +- `data == 2`: Memory fragment is allocated by `mmap`. + +However, I noticed that the `data` field is already being assigned the value `2` in the `reverveHigMem32()` function +```c +//src/custommem.c +void reverveHigMem32(void) { + // -- skipped -- + rb_set(mapallmem, (uintptr_t)cur, (uintptr_t)cur + cur_size, 2); + // -- skipped -- +} +``` +I couldn't find any documentation or code that clearly distinguishes this usage of `data == 2` in `mapallmem.` + +So my question is: what does `data == 2` represent in this context? +Alternatively, would it be acceptable if I use `data == 3` in `mapallmem` to indicate memory fragments allocated by `mmap`? + +To test this approach, I ran `chess.exe` with `box64` ([commit 93ebb0c](https://github.com/devarajabc/box64/commit/93ebb0c58a434bb6c0f39503b88a8b9ee4047139)) and `wine` (same config as in [issue #2511](https://github.com/ptitSeb/box64/issues/2511)). +Below is the result after merging `mmapmem` into `mapallmem`: + + +Compare to Box64 (v0.3.5 73dfe869): + + +As shown above, the total number of red-black tree nodes was reduced by approximately 81. +Since each node occupies 56 bytes, this translates to a memory saving of roughly 4.4 KB, which can become more significant when running larger programs with extensive memory mappings. + + + + + + |