From 595d2403c86de001136500efbec3dcd36848ecc3 Mon Sep 17 00:00:00 2001 From: Hamayama Date: Wed, 21 Jun 2017 00:30:24 +0300 Subject: [PATCH] Fix typed_test to prevent fails in malloc_explicitly_typed (64-bit) Issue #166 (bdwgc). * tests/test.c (typed_test): Pass 320*sizeof(word)+some_number instead of 2000 to GC_malloc_explicitly_typed, so that to satisfy the size argument requirement of the latter regardless of word size). --- tests/test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test.c b/tests/test.c index d6a091b8..42236418 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1112,7 +1112,8 @@ void typed_test(void) GC_descr d2 = GC_make_descriptor(bm2, 2); 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(2000, d4); + GC_word * x = (GC_word *)GC_malloc_explicitly_typed( + 320 * sizeof(GC_word) + 123, d4); int i; (void)GC_make_descriptor(bm_large, 32); -- 2.40.0