mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Perform more low-level code cleanup
This commit is contained in:
parent
c32e2d4486
commit
2d17ab016c
42 changed files with 977 additions and 265 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue