summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_unit.c')
-rw-r--r--src/nxt_unit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index 7230552d..564fd094 100644
--- a/src/nxt_unit.c
+++ b/src/nxt_unit.c
@@ -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);
}