Commits on Source (4)
-
Previously, in an attempt to reduce fragmentation, each new allocator would map a region of M32_MAX_PAGES fresh pages to seed itself. However, this ends up being extremely wasteful since it turns out that we often use fewer than this. Consequently, these pages end up getting freed which, ends up fragmenting our address space more than than we would have if we had naively allocated pages on-demand. Here we refactor m32 to avoid this waste while achieving the fragmentation mitigation previously desired. In particular, we move all page allocation into the global m32_alloc_page, which will pull a page from the free page pool. If the free page pool is empty we then refill it by allocating a region of M32_MAP_PAGES and adding them to the pool. Furthermore, we do away with the initial seeding entirely. That is, the allocator starts with no active pages: pages are rather allocated on an as-needed basis. On the whole this ends up being a pleasingly simple change, simultaneously making m32 more efficient, more robust, and simpler. Fixes #18980.
3fdad956 -
Use the GHC wrappers instead of <assert.h>.
ab14de08 -
In the past some people have confused ASSERT, which is for checking internal invariants, which CHECK, which should be used when checking things that might fail due to bad input (and therefore should be enabled even in the release compiler). Change some of these cases in the linker to use CHECK.
738bb286 -
See #18973.
be04dc9b
Showing
- .gitlab-ci.yml 2 additions, 0 deletions.gitlab-ci.yml
- rts/Linker.c 3 additions, 5 deletionsrts/Linker.c
- rts/linker/Elf.c 21 additions, 21 deletionsrts/linker/Elf.c
- rts/linker/M32Alloc.c 36 additions, 25 deletionsrts/linker/M32Alloc.c
- rts/linker/MachO.c 6 additions, 7 deletionsrts/linker/MachO.c
- rts/linker/PEi386.c 2 additions, 2 deletionsrts/linker/PEi386.c
- rts/linker/elf_got.c 3 additions, 3 deletionsrts/linker/elf_got.c
- rts/linker/elf_reloc_aarch64.c 27 additions, 28 deletionsrts/linker/elf_reloc_aarch64.c
- rts/win32/veh_excn.c 1 addition, 2 deletionsrts/win32/veh_excn.c