From 912a49c6091c1fd9b630d2e0966f0fe1b97a3e42 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 5 Mar 2018 17:32:50 +0300 Subject: Reduced number of critical log levels. --- src/nxt_malloc.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'src/nxt_malloc.c') diff --git a/src/nxt_malloc.c b/src/nxt_malloc.c index 568f04c6..910ef7cd 100644 --- a/src/nxt_malloc.c +++ b/src/nxt_malloc.c @@ -38,9 +38,8 @@ nxt_malloc(size_t size) nxt_log_debug(nxt_malloc_log(), "malloc(%uz): %p", size, p); } else { - nxt_log_moderate(&nxt_malloc_log_moderation, - NXT_LOG_ALERT, nxt_malloc_log(), - "malloc(%uz) failed %E", size, nxt_errno); + nxt_log_alert_moderate(&nxt_malloc_log_moderation, nxt_malloc_log(), + "malloc(%uz) failed %E", size, nxt_errno); } return p; @@ -73,9 +72,9 @@ nxt_realloc(void *p, size_t size) nxt_log_debug(nxt_malloc_log(), "realloc(%p, %uz): %p", p, size, n); } else { - nxt_log_moderate(&nxt_malloc_log_moderation, - NXT_LOG_ALERT, nxt_malloc_log(), - "realloc(%p, %uz) failed %E", p, size, nxt_errno); + nxt_log_alert_moderate(&nxt_malloc_log_moderation, nxt_malloc_log(), + "realloc(%p, %uz) failed %E", + p, size, nxt_errno); } return n; @@ -117,10 +116,9 @@ nxt_memalign(size_t alignment, size_t size) return p; } - nxt_log_moderate(&nxt_malloc_log_moderation, - NXT_LOG_ALERT, nxt_malloc_log(), - "posix_memalign(%uz, %uz) failed %E", - alignment, size, err); + nxt_log_alert_moderate(&nxt_malloc_log_moderation, nxt_malloc_log(), + "posix_memalign(%uz, %uz) failed %E", + alignment, size, err); return NULL; } @@ -141,10 +139,9 @@ nxt_memalign(size_t alignment, size_t size) return p; } - nxt_log_moderate(&nxt_malloc_log_moderation, - NXT_LOG_ALERT, nxt_malloc_log(), - "memalign(%uz, %uz) failed %E", - alignment, size, nxt_errno); + nxt_log_alert_moderate(&nxt_malloc_log_moderation, nxt_malloc_log(), + "memalign(%uz, %uz) failed %E", + alignment, size, nxt_errno); return NULL; } @@ -189,9 +186,8 @@ nxt_memalign(size_t alignment, size_t size) nxt_thread_log_debug("nxt_memalign(%uz, %uz): %p", alignment, size, p); } else { - nxt_log_moderate(&nxt_malloc_log_moderation, - NXT_LOG_ALERT, nxt_malloc_log(), - "malloc(%uz) failed %E", size, nxt_errno); + nxt_log_alert_moderate(&nxt_malloc_log_moderation, nxt_malloc_log(), + "malloc(%uz) failed %E", size, nxt_errno); } return p; -- cgit