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 0a6215c171
commit f1bba4a87c
346 changed files with 18286 additions and 17770 deletions

View file

@ -1,20 +1,17 @@
#include "test/jemalloc_test.h"
static uint32_t nuser_hook_calls;
static bool is_registered = false;
static bool is_registered = false;
static void
test_cb(bool is_alloc, uint64_t tallocated, uint64_t tdallocated) {
++nuser_hook_calls;
}
static user_hook_object_t tobj = {
.callback = &test_cb,
.interval = 10,
.is_alloc_only = false
};
.callback = &test_cb, .interval = 10, .is_alloc_only = false};
TEST_BEGIN(test_next_event_fast) {
tsd_t *tsd = tsd_fetch();
tsd_t *tsd = tsd_fetch();
te_ctx_t ctx;
te_ctx_get(tsd, &ctx, true);
@ -23,7 +20,8 @@ TEST_BEGIN(test_next_event_fast) {
te_ctx_next_event_set(tsd, &ctx, TE_NEXT_EVENT_FAST_MAX);
if (!is_registered) {
is_registered = 0 == te_register_user_handler(tsd_tsdn(tsd), &tobj);
is_registered = 0
== te_register_user_handler(tsd_tsdn(tsd), &tobj);
}
assert_true(is_registered || !config_stats, "Register user handler");
nuser_hook_calls = 0;
@ -35,7 +33,8 @@ TEST_BEGIN(test_next_event_fast) {
/* Test next_event_fast rolling back to 0. */
void *p = malloc(16U);
assert_true(nuser_hook_calls == 1 || !config_stats, "Expected alloc call");
assert_true(
nuser_hook_calls == 1 || !config_stats, "Expected alloc call");
assert_ptr_not_null(p, "malloc() failed");
free(p);
@ -48,6 +47,5 @@ TEST_END
int
main(void) {
return test(
test_next_event_fast);
return test(test_next_event_fast);
}