summaryrefslogtreecommitdiff
path: root/examples/redis-unstable/deps/jemalloc/test/analyze/sizes.c
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:52:54 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:52:54 +0100
commitdcacc00e3750300617ba6e16eb346713f91a783a (patch)
tree38e2d4fb5ed9d119711d4295c6eda4b014af73fd /examples/redis-unstable/deps/jemalloc/test/analyze/sizes.c
parent58dac10aeb8f5a041c46bddbeaf4c7966a99b998 (diff)
downloadcrep-dcacc00e3750300617ba6e16eb346713f91a783a.tar.gz
Remove testing data
Diffstat (limited to 'examples/redis-unstable/deps/jemalloc/test/analyze/sizes.c')
-rw-r--r--examples/redis-unstable/deps/jemalloc/test/analyze/sizes.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/examples/redis-unstable/deps/jemalloc/test/analyze/sizes.c b/examples/redis-unstable/deps/jemalloc/test/analyze/sizes.c
deleted file mode 100644
index 44c9de5..0000000
--- a/examples/redis-unstable/deps/jemalloc/test/analyze/sizes.c
+++ /dev/null
@@ -1,53 +0,0 @@
1#include "test/jemalloc_test.h"
2
3#include <stdio.h>
4
5/*
6 * Print the sizes of various important core data structures. OK, I guess this
7 * isn't really a "stress" test, but it does give useful information about
8 * low-level performance characteristics, as the other things in this directory
9 * do.
10 */
11
12static void
13do_print(const char *name, size_t sz_bytes) {
14 const char *sizes[] = {"bytes", "KB", "MB", "GB", "TB", "PB", "EB",
15 "ZB"};
16 size_t sizes_max = sizeof(sizes)/sizeof(sizes[0]);
17
18 size_t ind = 0;
19 double sz = sz_bytes;
20 while (sz >= 1024 && ind < sizes_max - 1) {
21 sz /= 1024;
22 ind++;
23 }
24 if (ind == 0) {
25 printf("%-20s: %zu bytes\n", name, sz_bytes);
26 } else {
27 printf("%-20s: %f %s\n", name, sz, sizes[ind]);
28 }
29}
30
31int
32main() {
33#define P(type) \
34 do_print(#type, sizeof(type))
35 P(arena_t);
36 P(arena_stats_t);
37 P(base_t);
38 P(decay_t);
39 P(edata_t);
40 P(ecache_t);
41 P(eset_t);
42 P(malloc_mutex_t);
43 P(prof_tctx_t);
44 P(prof_gctx_t);
45 P(prof_tdata_t);
46 P(rtree_t);
47 P(rtree_leaf_elm_t);
48 P(slab_data_t);
49 P(tcache_t);
50 P(tcache_slow_t);
51 P(tsd_t);
52#undef P
53}