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

@@ -10,8 +10,8 @@ TEST_BEGIN(test_sz_psz2ind) {
for (size_t i = 0; i < SC_NGROUP; i++) {
for (size_t psz = i * PAGE + 1; psz <= (i + 1) * PAGE; psz++) {
pszind_t ind = sz_psz2ind(psz);
expect_zu_eq(ind, i, "Got %u as sz_psz2ind of %zu", ind,
psz);
expect_zu_eq(
ind, i, "Got %u as sz_psz2ind of %zu", ind, psz);
}
}
@@ -25,15 +25,14 @@ TEST_BEGIN(test_sz_psz2ind) {
*/
size_t base_psz = 1 << (SC_LG_NGROUP + LG_PAGE);
size_t base_ind = 0;
while (base_ind < SC_NSIZES &&
reg_size_compute(data.sc[base_ind].lg_base,
data.sc[base_ind].lg_delta,
data.sc[base_ind].ndelta) < base_psz) {
while (base_ind < SC_NSIZES
&& reg_size_compute(data.sc[base_ind].lg_base,
data.sc[base_ind].lg_delta, data.sc[base_ind].ndelta)
< base_psz) {
base_ind++;
}
expect_zu_eq(
reg_size_compute(data.sc[base_ind].lg_base,
data.sc[base_ind].lg_delta, data.sc[base_ind].ndelta),
expect_zu_eq(reg_size_compute(data.sc[base_ind].lg_base,
data.sc[base_ind].lg_delta, data.sc[base_ind].ndelta),
base_psz, "Size class equal to %zu not found", base_psz);
/*
* Test different sizes falling into groups after the 'base'. The
@@ -42,21 +41,21 @@ TEST_BEGIN(test_sz_psz2ind) {
base_ind -= SC_NGROUP;
for (size_t psz = base_psz; psz <= 64 * 1024 * 1024; psz += PAGE / 3) {
pszind_t ind = sz_psz2ind(psz);
sc_t gt_sc = data.sc[ind + base_ind];
sc_t gt_sc = data.sc[ind + base_ind];
expect_zu_gt(psz,
reg_size_compute(gt_sc.lg_base, gt_sc.lg_delta,
gt_sc.ndelta),
reg_size_compute(
gt_sc.lg_base, gt_sc.lg_delta, gt_sc.ndelta),
"Got %u as sz_psz2ind of %zu", ind, psz);
sc_t le_sc = data.sc[ind + base_ind + 1];
expect_zu_le(psz,
reg_size_compute(le_sc.lg_base, le_sc.lg_delta,
le_sc.ndelta),
reg_size_compute(
le_sc.lg_base, le_sc.lg_delta, le_sc.ndelta),
"Got %u as sz_psz2ind of %zu", ind, psz);
}
pszind_t max_ind = sz_psz2ind(SC_LARGE_MAXCLASS + 1);
expect_lu_eq(max_ind, SC_NPSIZES,
"Got %u as sz_psz2ind of %llu", max_ind, SC_LARGE_MAXCLASS);
expect_lu_eq(max_ind, SC_NPSIZES, "Got %u as sz_psz2ind of %llu",
max_ind, SC_LARGE_MAXCLASS);
}
TEST_END