mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
parent
2d64b9994b
commit
10fd8bdb70
1397 changed files with 1204 additions and 5031 deletions
|
@ -23,12 +23,14 @@
|
|||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/spinlock.h"
|
||||
#include "libc/intrin/wait0.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/clone.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
|
@ -51,6 +53,11 @@ union Dub {
|
|||
double x;
|
||||
};
|
||||
|
||||
void SetUpOnce(void) {
|
||||
__enable_threads();
|
||||
ASSERT_SYS(0, 0, pledge("stdio", 0));
|
||||
}
|
||||
|
||||
int Worker(void *p, int tid) {
|
||||
int i;
|
||||
char str[64];
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/stdio/lock.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/hyperion.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/time.h"
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/stdio/iconv.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
TEST(iconv, test) {
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/thread/spawn.h"
|
||||
|
@ -39,6 +40,11 @@ int Worker(void *arg, int tid) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void SetUpOnce(void) {
|
||||
__enable_threads();
|
||||
ASSERT_SYS(0, 0, pledge("stdio", 0));
|
||||
}
|
||||
|
||||
TEST(memory, test) {
|
||||
int i, n = 32;
|
||||
struct spawn *t = gc(malloc(sizeof(struct spawn) * n));
|
||||
|
|
|
@ -90,13 +90,13 @@ const char kTinyLinuxExit[128] = {
|
|||
0x6a, 0x2a, 0x5f, 0x6a, 0x3c, 0x58, 0x0f, 0x05, // j*_j<X☼♣
|
||||
};
|
||||
|
||||
BENCH(spawn, bench) {
|
||||
int fd;
|
||||
if (IsLinux()) {
|
||||
fd = open("/tmp/tiny64", O_CREAT | O_TRUNC | O_WRONLY, 0755);
|
||||
write(fd, kTinyLinuxExit, 128);
|
||||
close(fd);
|
||||
EZBENCH2("spawn", donothing, BenchmarkProcessLifecycle());
|
||||
unlink("/tmp/tiny64");
|
||||
}
|
||||
}
|
||||
/* BENCH(spawn, bench) { */
|
||||
/* int fd; */
|
||||
/* if (IsLinux()) { */
|
||||
/* fd = open("/tmp/tiny64", O_CREAT | O_TRUNC | O_WRONLY, 0755); */
|
||||
/* write(fd, kTinyLinuxExit, 128); */
|
||||
/* close(fd); */
|
||||
/* EZBENCH2("spawn", donothing, BenchmarkProcessLifecycle()); */
|
||||
/* unlink("/tmp/tiny64"); */
|
||||
/* } */
|
||||
/* } */
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/hyperion.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue