1 #include "jemalloc/internal/jemalloc_preamble.h"
2 #include "jemalloc/internal/jemalloc_internal_includes.h"
4 static void (*safety_check_abort)(const char *message);
6 void safety_check_set_abort(void (*abort_fn)(const char *)) {
7 safety_check_abort = abort_fn;
10 void safety_check_fail(const char *format, ...) {
11 char buf[MALLOC_PRINTF_BUFSIZE];
15 malloc_vsnprintf(buf, MALLOC_PRINTF_BUFSIZE, format, ap);
18 if (safety_check_abort == NULL) {
22 safety_check_abort(buf);