mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Make spinlocks faster (take two)
This change is green on x86 and arm test fleet.
This commit is contained in:
parent
02e1cbcd00
commit
59692b0882
14 changed files with 122 additions and 79 deletions
|
@ -24,13 +24,13 @@
|
|||
|
||||
#define N 160
|
||||
|
||||
static bool IsDangerous(const void *ptr) {
|
||||
privileged static bool IsDangerous(const void *ptr) {
|
||||
if (_weaken(kisdangerous))
|
||||
return _weaken(kisdangerous)(ptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
static char *FormatHex(char *p, unsigned long x) {
|
||||
privileged static char *FormatHex(char *p, unsigned long x) {
|
||||
int k = x ? (__builtin_clzl(x) ^ 63) + 1 : 1;
|
||||
k = (k + 3) & -4;
|
||||
while (k > 0)
|
||||
|
@ -39,8 +39,8 @@ static char *FormatHex(char *p, unsigned long x) {
|
|||
return p;
|
||||
}
|
||||
|
||||
dontinstrument const char *(DescribeBacktrace)(char buf[N],
|
||||
const struct StackFrame *fr) {
|
||||
privileged dontinstrument const char *(
|
||||
DescribeBacktrace)(char buf[N], const struct StackFrame *fr) {
|
||||
char *p = buf;
|
||||
char *pe = p + N;
|
||||
bool gotsome = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue