(Apply commit
9c6d1b3 from 'master' branch.)
* tests/disclaim_bench.c (main): Check GC_MALLOC result for NULL
(abort in case of out-of-memory) before dereference.
* tests/test.c (run_one_test): Likewise.
GC_INIT();
GC_init_finalized_malloc();
-
- keep_arr = GC_MALLOC(sizeof(void *)*KEEP_CNT);
-
if (argc == 2 && strcmp(argv[1], "--help") == 0) {
fprintf(stderr,
"Usage: %s [FINALIZATION_MODEL]\n"
model_max = 2;
}
+ keep_arr = GC_MALLOC(sizeof(void *) * KEEP_CNT);
+ if (NULL == keep_arr) {
+ fprintf(stderr, "Out of memory!\n");
+ exit(3);
+ }
+
printf("\t\t\tfin. ratio time/s time/fin.\n");
for (model = model_min; model <= model_max; ++model) {
double t = 0.0;
FAIL;
}
z = GC_malloc(8);
+ CHECK_OUT_OF_MEMORY(z);
GC_PTR_STORE(z, x);
if (*z != x) {
GC_printf("GC_PTR_STORE failed: %p != %p\n", (void *)(*z), (void *)x);