mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 12:30:30 +00:00
Make realloc() go 100x faster on Linux/NetBSD
Cosmopolitan now supports mremap(), which is only supported on Linux and NetBSD. First, it allows memory mappings to be relocated without copying them; this can dramatically speed up data structures like std::vector if the array size grows larger than 256kb. The mremap() system call is also 10x faster than munmap() when shrinking large memory mappings. There's now two functions, getpagesize() and getgransize() which help to write portable code that uses mmap(MAP_FIXED). Alternative sysconf() may be called with our new _SC_GRANSIZE. The madvise() system call now has a better wrapper with improved documentation.
This commit is contained in:
parent
196942084b
commit
f7780de24b
71 changed files with 1301 additions and 640 deletions
|
@ -59,7 +59,7 @@ scall __sys_pipe 0x02a10721e202a016 0x03b globl hidden # NOTE: pipe2() on FreeB
|
|||
scall sys_select 0x9a184785d285d817 0xfff globl hidden
|
||||
scall sys_pselect 0x9b486ea0a298a90e 0x848 globl hidden # pselect6() on gnu/systemd
|
||||
scall sys_sched_yield 0x15e12a14bf25d018 0x07c globl hidden # select() on XNU (previously swtch() but removed in 12.4)
|
||||
scall __sys_mremap 0x19bffffffffff019 0x0d8 globl hidden
|
||||
scall sys_mremap 0x19bffffffffff019 0x0d8 globl hidden
|
||||
scall sys_mincore 0x04e04e04e204e01b 0x0e8 globl hidden
|
||||
scall sys_madvise 0x04b04b04b204b01c 0x0e9 globl hidden
|
||||
scall sys_shmget 0x0e71210e7210901d 0x0c2 globl # no wrapper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue