Make mappings unlimited on NT

This change might also fix fork() in certain cases on NT.
This commit is contained in:
Justine Tunney 2021-09-04 13:20:47 -07:00
parent ab64c746cc
commit 34b68f1945
31 changed files with 356 additions and 127 deletions

View file

@ -23,6 +23,7 @@
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "libc/testlib/ezbench.h"
#include "libc/testlib/testlib.h"
#include "libc/x/x.h"
@ -73,3 +74,22 @@ TEST(gclongjmp, test) {
free(y);
free(x);
}
void F1(void) {
/* 3x slower than F2() but sooo worth it */
_gc(malloc(16));
}
void F2(void) {
void *volatile p;
p = malloc(16);
free(p);
}
void (*F1p)(void) = F1;
void (*F2p)(void) = F2;
BENCH(gc, bench) {
EZBENCH2("gc(malloc(16))", donothing, F1p());
EZBENCH2("free(malloc(16))", donothing, F2p());
}