mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
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
This commit is contained in:
parent
98c5847727
commit
0b3c81dd4e
44 changed files with 769 additions and 649 deletions
|
@ -71,8 +71,17 @@ bool32 VirtualUnlock(const void *lpAddress, size_t dwSize);
|
|||
uint64_t VirtualQuery(const void *lpAddress,
|
||||
struct NtMemoryBasicInformation *lpBuffer,
|
||||
uint64_t dwLength);
|
||||
uint64_t VirtualQueryEx(int64_t hProcess, const void *lpAddress,
|
||||
struct NtMemoryBasicInformation *lpBuffer,
|
||||
uint64_t dwLength);
|
||||
|
||||
void *VirtualAllocEx(int64_t hProcess, void *lpAddress, uint64_t dwSize,
|
||||
uint32_t flAllocationType, uint32_t flProtect);
|
||||
bool32 VirtualProtectEx(int64_t hProcess, void *lpAddress, uint64_t dwSize,
|
||||
uint32_t flNewProtect, uint32_t *out_lpflOldProtect);
|
||||
bool32 WriteProcessMemory(int64_t hProcess, void *lpBaseAddress,
|
||||
const void *lpBuffer, uint64_t nSize,
|
||||
uint64_t *opt_out_lpNumberOfBytesWritten);
|
||||
|
||||
int64_t GetProcessHeap(void);
|
||||
void *HeapAlloc(int64_t hHeap, uint32_t dwFlags, size_t dwBytes) __wur;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue