]> granicus.if.org Git - gc/commitdiff
Fix typed_test to prevent fails in malloc_explicitly_typed (64-bit)
authorHamayama <hamay1010@gmail.com>
Tue, 20 Jun 2017 21:30:24 +0000 (00:30 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 4 Jul 2017 21:37:58 +0000 (00:37 +0300)
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

index cc363ae055e35c9bdd6e54c7c7796e99fd5bab10..0c4e9eace760a5be841fb8e8b2810f9ecee4ecb3 100644 (file)
@@ -1038,7 +1038,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;
 
 #   ifndef LINT