cosmopolitan/libc/nt/kernel32/VirtualQueryEx.S
Justine Tunney 0b3c81dd4e
Make fork() go 30% faster
This change makes fork() go nearly as fast as sys_fork() on UNIX. As for
Windows this change shaves about 4-5ms off fork() + wait() latency. This
is accomplished by using WriteProcessMemory() from the parent process to
setup the address space of a suspended process; it is better than a pipe
2025-01-01 04:59:38 -08:00

18 lines
317 B
ArmAsm

#include "libc/nt/codegen.h"
.imp kernel32,__imp_VirtualQueryEx,VirtualQueryEx
.text.windows
.ftrace1
VirtualQueryEx:
.ftrace2
#ifdef __x86_64__
push %rbp
mov %rsp,%rbp
mov __imp_VirtualQueryEx(%rip),%rax
jmp __sysv2nt
#elif defined(__aarch64__)
mov x0,#0
ret
#endif
.endfn VirtualQueryEx,globl
.previous