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;
static const struct GC_finalizer_closure fc = { pair_dct, NULL };
p = GC_finalized_malloc(sizeof(struct pair_s), &fc);
- my_assert(!is_pair(p));
if (p == NULL) {
fprintf(stderr, "Out of memory!\n");
exit(3);
}
+ my_assert(!is_pair(p));
my_assert(memeq(p, 0, sizeof(struct pair_s)));
memcpy(p->magic, pair_magic, sizeof(p->magic));
p->checksum = 782 + (car? car->checksum : 0) + (cdr? cdr->checksum : 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);