Libunit: improving logging consistency.

Debug logging depends on macros defined in nxt_auto_config.h.
This commit is contained in:
Max Romanov
2020-11-18 22:33:53 +03:00
parent fb80502513
commit 8340ca0b9c
5 changed files with 11 additions and 6 deletions

View File

@@ -6527,7 +6527,9 @@ nxt_unit_malloc(nxt_unit_ctx_t *ctx, size_t size)
p = malloc(size);
if (nxt_fast_path(p != NULL)) {
#if (NXT_DEBUG_ALLOC)
nxt_unit_debug(ctx, "malloc(%d): %p", (int) size, p);
#endif
} else {
nxt_unit_alert(ctx, "malloc(%d) failed: %s (%d)",
@@ -6541,7 +6543,9 @@ nxt_unit_malloc(nxt_unit_ctx_t *ctx, size_t size)
void
nxt_unit_free(nxt_unit_ctx_t *ctx, void *p)
{
#if (NXT_DEBUG_ALLOC)
nxt_unit_debug(ctx, "free(%p)", p);
#endif
free(p);
}