diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2023-03-16 09:46:57 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-03-16 13:27:35 +0300 |
commit | 597a426ec4ddf294e2738b91d7ef5284b9989ea7 (patch) | |
tree | f15ad524f967783896ae3c100b8bb49574d8428c /tests | |
parent | 5871f287efc913063e9c42aef5962bebdc3f4692 (diff) | |
download | bdwgc-597a426ec4ddf294e2738b91d7ef5284b9989ea7.tar.gz |
Define counter variables as static in gctest
(refactoring)
* tests/gctest.c (uncollectable_count, collectable_count, atomic_count,
realloc_count, extra_count): Define as static variable.
* tests/gctest.c [GC_PTHREADS] (gcollect_threads_cnt): Likewise.
* tests/gctest.c [!DBG_HDRS_ALL] (fail_count): Likewise.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gctest.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/gctest.c b/tests/gctest.c index 75dda7de..d83bbf49 100644 --- a/tests/gctest.c +++ b/tests/gctest.c @@ -225,12 +225,13 @@ #endif /* Allocation Statistics. Synchronization is not strictly necessary. */ -volatile AO_t uncollectable_count = 0; -volatile AO_t collectable_count = 0; -volatile AO_t atomic_count = 0; -volatile AO_t realloc_count = 0; +static volatile AO_t uncollectable_count = 0; +static volatile AO_t collectable_count = 0; +static volatile AO_t atomic_count = 0; +static volatile AO_t realloc_count = 0; -volatile AO_t extra_count = 0; /* Amount of space wasted in cons node; */ +static volatile AO_t extra_count = 0; + /* Amount of space wasted in cons node; */ /* also used in gcj_cons, mktree and */ /* chktree (for other purposes). */ @@ -484,7 +485,7 @@ sexpr reverse(sexpr x) } # define MAX_GCOLLECT_THREADS ((NTHREADS+2)/3) - volatile AO_t gcollect_threads_cnt = 0; + static volatile AO_t gcollect_threads_cnt = 0; #endif /* GC_PTHREADS */ sexpr ints(int low, int up) @@ -1414,7 +1415,7 @@ void typed_test(void) #ifdef DBG_HDRS_ALL # define set_print_procs() (void)(A.dummy = 17) #else - volatile AO_t fail_count = 0; + static volatile AO_t fail_count = 0; void GC_CALLBACK fail_proc1(void *arg) { |