mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +00:00
Reduce stack virtual memory consumption on Linux
This commit is contained in:
parent
cc8a9eb93c
commit
36e5861b0c
31 changed files with 583 additions and 166 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/describeflags.h"
|
||||
#include "libc/intrin/rlimit.h"
|
||||
#include "libc/intrin/strace.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
|
@ -47,8 +48,7 @@ int getrlimit(int resource, struct rlimit *rlim) {
|
|||
} else if (!IsWindows()) {
|
||||
rc = sys_getrlimit(resource, rlim);
|
||||
} else if (resource == RLIMIT_STACK) {
|
||||
rlim->rlim_cur = GetStaticStackSize();
|
||||
rlim->rlim_max = GetStaticStackSize();
|
||||
*rlim = __rlimit_stack_get();
|
||||
rc = 0;
|
||||
} else if (resource == RLIMIT_AS) {
|
||||
rlim->rlim_cur = __virtualmax;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue