mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Rewrite memory manager
Actually Portable Executable now supports Android. Cosmo's old mmap code required a 47 bit address space. The new implementation is very agnostic and supports both smaller address spaces (e.g. embedded) and even modern 56-bit PML5T paging for x86 which finally came true on Zen4 Threadripper Cosmopolitan no longer requires UNIX systems to observe the Windows 64kb granularity; i.e. sysconf(_SC_PAGE_SIZE) will now report the host native page size. This fixes a longstanding POSIX conformance issue, concerning file mappings that overlap the end of file. Other aspects of conformance have been improved too, such as the subtleties of address assignment and and the various subtleties surrounding MAP_FIXED and MAP_FIXED_NOREPLACE On Windows, mappings larger than 100 megabytes won't be broken down into thousands of independent 64kb mappings. Support for MAP_STACK is removed by this change; please use NewCosmoStack() instead. Stack overflow avoidance is now being implemented using the POSIX thread APIs. Please use GetStackBottom() and GetStackAddr(), instead of the old error-prone GetStackAddr() and HaveStackMemory() APIs which are removed.
This commit is contained in:
parent
7f6d0b8709
commit
6ffed14b9c
150 changed files with 1893 additions and 5634 deletions
10
third_party/dlmalloc/README.cosmo
vendored
10
third_party/dlmalloc/README.cosmo
vendored
|
@ -9,9 +9,9 @@ LICENSE
|
|||
|
||||
LOCAL CHANGES
|
||||
|
||||
- Use thread-local freelist from cosmo tib
|
||||
- Define dlmalloc_requires_more_vespene_gas()
|
||||
- Make dlmalloc scalable using sched_getcpu()
|
||||
- Use faster two power roundup for memalign()
|
||||
- Poison maps to integrate with Address Sanitizer
|
||||
- Introduce __oom_hook() by using _mapanon() vs. mmap()
|
||||
- Wrap locks with __threaded check to improve perf lots
|
||||
- Use assembly init rather than ensure_initialization()
|
||||
- Implemented the locking functions dlmalloc wants
|
||||
- Use assembly _init() rather than ensure_initialization()
|
||||
- Rather than calling mmap() 96 times from _start() just use .bss
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue