mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
Improve dlopen() on Apple Silicon
- Introduce MAP_JIT which is zero on other platforms - Invent __jit_begin() and __jit_end() which wrap Apple's APIs - Runtime dispatch to sys_icache_invalidate() in __clear_cache()
This commit is contained in:
parent
7a9e176ecf
commit
529cb4817c
20 changed files with 120 additions and 117 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/directmap.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/runtime/syslib.internal.h"
|
||||
|
||||
/**
|
||||
* Unmaps memory directly with system.
|
||||
|
@ -32,10 +33,12 @@
|
|||
*/
|
||||
int sys_munmap(void *p, size_t n) {
|
||||
int rc;
|
||||
if (!IsMetal()) {
|
||||
rc = __sys_munmap(p, n);
|
||||
} else {
|
||||
if (IsXnuSilicon()) {
|
||||
rc = _sysret(__syslib->__munmap(p, n));
|
||||
} else if (IsMetal()) {
|
||||
rc = sys_munmap_metal(p, n);
|
||||
} else {
|
||||
rc = __sys_munmap(p, n);
|
||||
}
|
||||
KERNTRACE("sys_munmap(%p /* %s */, %'zu) → %d", p,
|
||||
DescribeFrame((intptr_t)p >> 16), n, rc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue