diff options
author | bugaevskiy <bugaevskiy@yandex-team.ru> | 2022-02-10 16:46:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:17 +0300 |
commit | a6e0145a095c7bb3770d6e07aee301de5c73f96e (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/jemalloc/src/safety_check.c | |
parent | c7f68570483e493f4ddaf946de7b3a420ee621b0 (diff) | |
download | ydb-a6e0145a095c7bb3770d6e07aee301de5c73f96e.tar.gz |
Restoring authorship annotation for <bugaevskiy@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/jemalloc/src/safety_check.c')
-rw-r--r-- | contrib/libs/jemalloc/src/safety_check.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/contrib/libs/jemalloc/src/safety_check.c b/contrib/libs/jemalloc/src/safety_check.c index 78bd9912d4..804155dcfc 100644 --- a/contrib/libs/jemalloc/src/safety_check.c +++ b/contrib/libs/jemalloc/src/safety_check.c @@ -1,24 +1,24 @@ -#include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" - -static void (*safety_check_abort)(const char *message); - -void safety_check_set_abort(void (*abort_fn)(const char *)) { - safety_check_abort = abort_fn; -} - -void safety_check_fail(const char *format, ...) { - char buf[MALLOC_PRINTF_BUFSIZE]; - - va_list ap; - va_start(ap, format); - malloc_vsnprintf(buf, MALLOC_PRINTF_BUFSIZE, format, ap); - va_end(ap); - - if (safety_check_abort == NULL) { - malloc_write(buf); - abort(); - } else { - safety_check_abort(buf); - } -} +#include "jemalloc/internal/jemalloc_preamble.h" +#include "jemalloc/internal/jemalloc_internal_includes.h" + +static void (*safety_check_abort)(const char *message); + +void safety_check_set_abort(void (*abort_fn)(const char *)) { + safety_check_abort = abort_fn; +} + +void safety_check_fail(const char *format, ...) { + char buf[MALLOC_PRINTF_BUFSIZE]; + + va_list ap; + va_start(ap, format); + malloc_vsnprintf(buf, MALLOC_PRINTF_BUFSIZE, format, ap); + va_end(ap); + + if (safety_check_abort == NULL) { + malloc_write(buf); + abort(); + } else { + safety_check_abort(buf); + } +} |