mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Change noinline to dontinline (#312)
We defined `noinline` as an abbreviation for the longer version `__attribute__((__noinline__))` which caused name clashes since third party codebases often write it as `__attribute__((noinline))`.
This commit is contained in:
parent
ca611efc43
commit
6f658f058b
59 changed files with 122 additions and 122 deletions
|
@ -119,7 +119,7 @@ forceinline uint64_t Rando(void) {
|
|||
KnuthLinearCongruentialGenerator(&g_rando) >> 32;
|
||||
}
|
||||
|
||||
noinline void RngSet(void *mem, size_t size) {
|
||||
dontinline void RngSet(void *mem, size_t size) {
|
||||
uint64_t coin;
|
||||
DCHECK(size % 8 == 0);
|
||||
for (size >>= 3; size--;) {
|
||||
|
|
|
@ -76,12 +76,12 @@ TEST(gclongjmp, test) {
|
|||
free(x);
|
||||
}
|
||||
|
||||
noinline void F1(void) {
|
||||
dontinline void F1(void) {
|
||||
/* 3x slower than F2() but sooo worth it */
|
||||
gc(malloc(16));
|
||||
}
|
||||
|
||||
noinline void F2(void) {
|
||||
dontinline void F2(void) {
|
||||
void *volatile p;
|
||||
p = malloc(16);
|
||||
free(p);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
long i, j, n;
|
||||
char *b0, *b1, *b2;
|
||||
|
||||
noinline char *PosixMemmove(char *dst, const char *src, size_t n) {
|
||||
dontinline char *PosixMemmove(char *dst, const char *src, size_t n) {
|
||||
char *tmp;
|
||||
tmp = malloc(n);
|
||||
memcpy(tmp, src, n);
|
||||
|
|
|
@ -76,7 +76,7 @@ void ctrdrbg2(void *p, size_t n) {
|
|||
mbedtls_ctr_drbg_free(&rng);
|
||||
}
|
||||
|
||||
noinline uint64_t xorshift(void) {
|
||||
dontinline uint64_t xorshift(void) {
|
||||
static uint64_t s = 88172645463325252;
|
||||
uint64_t x = s;
|
||||
x ^= x << 13;
|
||||
|
@ -85,7 +85,7 @@ noinline uint64_t xorshift(void) {
|
|||
return (s = x);
|
||||
}
|
||||
|
||||
noinline void xorshifta(char *p, size_t n) {
|
||||
dontinline void xorshifta(char *p, size_t n) {
|
||||
static uint64_t s = 88172645463325252;
|
||||
uint64_t x = s;
|
||||
while (n >= 8) {
|
||||
|
@ -103,7 +103,7 @@ noinline void xorshifta(char *p, size_t n) {
|
|||
}
|
||||
}
|
||||
|
||||
noinline uint64_t knuth(void) {
|
||||
dontinline uint64_t knuth(void) {
|
||||
uint64_t a, b;
|
||||
static uint64_t x = 1;
|
||||
x *= 6364136223846793005;
|
||||
|
@ -115,7 +115,7 @@ noinline uint64_t knuth(void) {
|
|||
return a | b << 32;
|
||||
}
|
||||
|
||||
noinline void knutha(char *p, size_t n) {
|
||||
dontinline void knutha(char *p, size_t n) {
|
||||
static uint64_t s = 1;
|
||||
uint32_t u;
|
||||
uint64_t x = s;
|
||||
|
|
|
@ -50,7 +50,7 @@ TEST(crc32c, test) {
|
|||
EXPECT_EQ(0xecc9871d, crc32c(0, kHyperion, kHyperionSize));
|
||||
}
|
||||
|
||||
noinline uint64_t fnv_hash(char *s, int len) {
|
||||
dontinline uint64_t fnv_hash(char *s, int len) {
|
||||
uint64_t hash = 0xcbf29ce484222325;
|
||||
for (int i = 0; i < len; i++) {
|
||||
hash *= 0x100000001b3;
|
||||
|
|
|
@ -496,14 +496,14 @@ TEST(wcsncmp, testTwosComplementBane) {
|
|||
│ test/libc/str/strcmp_test.c § benchmarks ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
testonly noinline int strcmp_pure(const char *a, const char *b) {
|
||||
testonly dontinline int strcmp_pure(const char *a, const char *b) {
|
||||
for (; *a == *b; a++, b++) {
|
||||
if (!*a) break;
|
||||
}
|
||||
return (*a & 0xff) - (*b & 0xff);
|
||||
}
|
||||
|
||||
testonly noinline int strcasecmp_pure(const char *a, const char *b) {
|
||||
testonly dontinline int strcasecmp_pure(const char *a, const char *b) {
|
||||
for (; *a && *b; a++, b++) {
|
||||
if (!(*a == *b || tolower(*a & 0xff) == tolower(*b & 0xff))) {
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue