summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_malloc.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-03-05 17:32:50 +0300
committerValentin Bartenev <vbart@nginx.com>2018-03-05 17:32:50 +0300
commit912a49c6091c1fd9b630d2e0966f0fe1b97a3e42 (patch)
tree5581735807436384796dfd9deff336865c8372e4 /src/nxt_malloc.c
parentf2090bce21e4fb47d11f992a76ef5c4da74c3233 (diff)
downloadunit-912a49c6091c1fd9b630d2e0966f0fe1b97a3e42.tar.gz
unit-912a49c6091c1fd9b630d2e0966f0fe1b97a3e42.tar.bz2
Reduced number of critical log levels.
Diffstat (limited to 'src/nxt_malloc.c')
-rw-r--r--src/nxt_malloc.c30
1 files changed, 13 insertions, 17 deletions
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;