Perform more low-level code cleanup

This commit is contained in:
Justine Tunney 2022-09-09 04:07:08 -07:00
parent c32e2d4486
commit 2d17ab016c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
42 changed files with 977 additions and 265 deletions

View file

@ -19,6 +19,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/ucontext.h"
#include "libc/runtime/runtime.h"
#include "libc/testlib/ezbench.h"
#include "libc/testlib/testlib.h"
int x;
@ -47,3 +48,17 @@ TEST(getcontext, test) {
ASSERT_TRUE(ok1);
ASSERT_TRUE(ok2);
}
void SetGetContext(void) {
static int a;
a = 0;
getcontext(&context);
if (!a) {
a = 1;
setcontext(&context);
}
}
BENCH(getcontext, bench) {
EZBENCH2("get/setcontext", donothing, SetGetContext());
}