diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2023-01-31 19:52:40 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-01-31 23:01:01 +0300 |
commit | 30d32b4e9ed35628c8c75faf6e639d256886e072 (patch) | |
tree | 6f486bf52ec1891d3df354c9d5293ff66ccd3907 /tests/disclaim_bench.c | |
parent | 1754cd484ea6ef1168134472adcca447b9246a48 (diff) | |
download | bdwgc-30d32b4e9ed35628c8c75faf6e639d256886e072.tar.gz |
Do not mix debug and non-debug allocations in disclaim tests
* include/gc/gc_disclaim.h (GC_finalized_malloc): Add comment that the
debugging version of the function is missing.
* tests/disclaim_bench.c (testobj_new): Use GC_malloc() instead of
GC_NEW().
* tests/weakmap.c (weakmap_add, weakmap_new): Likewise.
* tests/disclaim_bench.c (testobj_new): Use
GC_register_finalizer_no_order() instead of
GC_REGISTER_FINALIZER_NO_ORDER().
* tests/disclaim_bench.c (main): Use GC_malloc() instead of
GC_MALLOC().
* tests/weakmap.c (weakmap_add, weakmap_new): Use
GC_ptr_store_and_dirty() instead of GC_PTR_STORE_AND_DIRTY().
Diffstat (limited to 'tests/disclaim_bench.c')
-rw-r--r-- | tests/disclaim_bench.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/disclaim_bench.c b/tests/disclaim_bench.c index 8525063d..aab9275f 100644 --- a/tests/disclaim_bench.c +++ b/tests/disclaim_bench.c @@ -62,9 +62,9 @@ testobj_t testobj_new(int model) switch (model) { # ifndef GC_NO_FINALIZATION case 0: - obj = GC_NEW(struct testobj_s); + obj = (struct testobj_s *)GC_malloc(sizeof(struct testobj_s)); if (obj != NULL) - GC_REGISTER_FINALIZER_NO_ORDER(obj, testobj_finalize, + GC_register_finalizer_no_order(obj, testobj_finalize, &free_count, NULL, NULL); break; # endif @@ -73,7 +73,7 @@ testobj_t testobj_new(int model) &fclos); break; case 2: - obj = GC_NEW(struct testobj_s); + obj = (struct testobj_s *)GC_malloc(sizeof(struct testobj_s)); break; default: exit(-1); @@ -127,7 +127,7 @@ int main(int argc, char **argv) if (GC_get_find_leak()) printf("This test program is not designed for leak detection mode\n"); - keep_arr = (testobj_t *)GC_MALLOC(sizeof(void *) * KEEP_CNT); + keep_arr = (testobj_t *)GC_malloc(sizeof(void *) * KEEP_CNT); if (NULL == keep_arr) { fprintf(stderr, "Out of memory!\n"); exit(3); |