do_free = free;
} else {
GC_init();
+#ifdef HAVE_GC_GET_ALL_INTERIOR_POINTERS
+ assert(GC_get_all_interior_pointers());
+#else
assert(GC_all_interior_pointers);
+#endif
}
#endif
}
void *ptr;
if(!(ptr = do_malloc(n)) && n)
- fatal(errno, "error allocating memory");
+ disorder_fatal(errno, "error allocating memory");
return ptr;
}
*/
void *xrealloc(void *ptr, size_t n) {
if(!(ptr = do_realloc(ptr, n)) && n)
- fatal(errno, "error allocating memory");
+ disorder_fatal(errno, "error allocating memory");
return ptr;
}
*/
void *xcalloc(size_t count, size_t size) {
if(count > SIZE_MAX / size)
- fatal(0, "excessively large calloc");
+ disorder_fatal(0, "excessively large calloc");
return xmalloc(count * size);
}
void *ptr;
if(!(ptr = do_malloc_atomic(n)) && n)
- fatal(errno, "error allocating memory");
+ disorder_fatal(errno, "error allocating memory");
return ptr;
}
*/
void *xcalloc_noptr(size_t count, size_t size) {
if(count > SIZE_MAX / size)
- fatal(0, "excessively large calloc");
+ disorder_fatal(0, "excessively large calloc");
return xmalloc_noptr(count * size);
}
if(ptr == 0)
return xmalloc_noptr(n);
if(!(ptr = do_realloc(ptr, n)) && n)
- fatal(errno, "error allocating memory");
+ disorder_fatal(errno, "error allocating memory");
return ptr;
}
char *t;
if(!(t = do_malloc_atomic(strlen(s) + 1)))
- fatal(errno, "error allocating memory");
+ disorder_fatal(errno, "error allocating memory");
return strcpy(t, s);
}
char *t;
if(!(t = do_malloc_atomic(n + 1)))
- fatal(errno, "error allocating memory");
+ disorder_fatal(errno, "error allocating memory");
memcpy(t, s, n);
t[n] = 0;
return t;