From 1862f525889139526ccedc22a0a9648f79f72f26 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 1 Apr 2019 22:13:18 +0300 Subject: [PATCH] Add testing of GC_CALLOC/MALLOC_EXPLICITLY_TYPED (gctest) * tests/test.c (typed_test): Call GC_MALLOC_EXPLICITLY_TYPED() instead of GC_malloc_explicitly_typed(); call GC_CALLOC_EXPLICITLY_TYPED() instead of GC_calloc_explicitly_typed(). --- tests/test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test.c b/tests/test.c index a1ce0bcf..aef85531 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1183,7 +1183,7 @@ void typed_test(void) GC_descr d2; GC_descr d3 = GC_make_descriptor(bm_large, 32); GC_descr d4 = GC_make_descriptor(bm_huge, 320); - GC_word * x = (GC_word *)GC_malloc_explicitly_typed( + GC_word * x = (GC_word *)GC_MALLOC_EXPLICITLY_TYPED( 320 * sizeof(GC_word) + 123, d4); int i; @@ -1201,7 +1201,7 @@ void typed_test(void) d2 = GC_make_descriptor(bm2, 2); old = 0; for (i = 0; i < 4000; i++) { - newP = (GC_word *)GC_malloc_explicitly_typed(4 * sizeof(GC_word), d1); + newP = (GC_word *)GC_MALLOC_EXPLICITLY_TYPED(4 * sizeof(GC_word), d1); CHECK_OUT_OF_MEMORY(newP); AO_fetch_and_add1(&collectable_count); if (newP[0] != 0 || newP[1] != 0) { @@ -1212,19 +1212,19 @@ void typed_test(void) GC_PTR_STORE_AND_DIRTY(newP + 1, old); old = newP; AO_fetch_and_add1(&collectable_count); - newP = (GC_word *)GC_malloc_explicitly_typed(4 * sizeof(GC_word), d2); + newP = (GC_word *)GC_MALLOC_EXPLICITLY_TYPED(4 * sizeof(GC_word), d2); CHECK_OUT_OF_MEMORY(newP); newP[0] = 17; GC_PTR_STORE_AND_DIRTY(newP + 1, old); old = newP; AO_fetch_and_add1(&collectable_count); - newP = (GC_word*)GC_malloc_explicitly_typed(33 * sizeof(GC_word), d3); + newP = (GC_word*)GC_MALLOC_EXPLICITLY_TYPED(33 * sizeof(GC_word), d3); CHECK_OUT_OF_MEMORY(newP); newP[0] = 17; GC_PTR_STORE_AND_DIRTY(newP + 1, old); old = newP; AO_fetch_and_add1(&collectable_count); - newP = (GC_word *)GC_calloc_explicitly_typed(4, 2 * sizeof(GC_word), + newP = (GC_word *)GC_CALLOC_EXPLICITLY_TYPED(4, 2 * sizeof(GC_word), d1); CHECK_OUT_OF_MEMORY(newP); newP[0] = 17; @@ -1232,10 +1232,10 @@ void typed_test(void) old = newP; AO_fetch_and_add1(&collectable_count); if (i & 0xff) { - newP = (GC_word *)GC_calloc_explicitly_typed(7, 3 * sizeof(GC_word), + newP = (GC_word *)GC_CALLOC_EXPLICITLY_TYPED(7, 3 * sizeof(GC_word), d2); } else { - newP = (GC_word *)GC_calloc_explicitly_typed(1001, + newP = (GC_word *)GC_CALLOC_EXPLICITLY_TYPED(1001, 3 * sizeof(GC_word), d2); if (newP != NULL && (newP[0] != 0 || newP[1] != 0)) { -- 2.40.0