]> 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, 20 Jun 2017 21:30:24 +0000 (00:30 +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 d6a091b8ee62417a814f1244d73a830643840008..4223641819c3ebec03048548c3a1c7bbbcda0070 100644 (file)
@@ -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);