Reformat the codebase with the clang-format 18.

This commit is contained in:
guangli-dai
2025-06-13 12:31:12 -07:00
committed by Guangli Dai
parent a952a3b8b0
commit 6200e8987f
346 changed files with 18286 additions and 17770 deletions

View File

@@ -6,27 +6,27 @@ void *
thd_start(void *arg) {
unsigned thread_ind = (unsigned)(uintptr_t)arg;
unsigned arena_ind;
void *p;
size_t sz;
void *p;
size_t sz;
sz = sizeof(arena_ind);
expect_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
0, "Error in arenas.create");
if (thread_ind % 4 != 3) {
size_t mib[3];
size_t miblen = sizeof(mib) / sizeof(size_t);
size_t mib[3];
size_t miblen = sizeof(mib) / sizeof(size_t);
const char *dss_precs[] = {"disabled", "primary", "secondary"};
unsigned prec_ind = thread_ind %
(sizeof(dss_precs)/sizeof(char*));
unsigned prec_ind = thread_ind
% (sizeof(dss_precs) / sizeof(char *));
const char *dss = dss_precs[prec_ind];
int expected_err = (have_dss || prec_ind == 0) ? 0 : EFAULT;
expect_d_eq(mallctlnametomib("arena.0.dss", mib, &miblen), 0,
"Error in mallctlnametomib()");
mib[1] = arena_ind;
expect_d_eq(mallctlbymib(mib, miblen, NULL, NULL, (void *)&dss,
sizeof(const char *)), expected_err,
"Error in mallctlbymib()");
sizeof(const char *)),
expected_err, "Error in mallctlbymib()");
}
p = mallocx(1, MALLOCX_ARENA(arena_ind));
@@ -37,12 +37,11 @@ thd_start(void *arg) {
}
TEST_BEGIN(test_MALLOCX_ARENA) {
thd_t thds[NTHREADS];
thd_t thds[NTHREADS];
unsigned i;
for (i = 0; i < NTHREADS; i++) {
thd_create(&thds[i], thd_start,
(void *)(uintptr_t)i);
thd_create(&thds[i], thd_start, (void *)(uintptr_t)i);
}
for (i = 0; i < NTHREADS; i++) {
@@ -53,6 +52,5 @@ TEST_END
int
main(void) {
return test(
test_MALLOCX_ARENA);
return test(test_MALLOCX_ARENA);
}