aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_alloc.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-02-11 17:08:49 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-02-11 17:08:49 +0000
commit54498db7a2a2e7e74fba61ec073b248da05e999e (patch)
tree7e5bda151896efa349f2220fc122ba9792ce5dfb /src/core/ngx_alloc.c
parentc7a2f6860669f45f5abe342163de5bc68e344816 (diff)
downloadnginx-54498db7a2a2e7e74fba61ec073b248da05e999e.tar.gz
nginx-54498db7a2a2e7e74fba61ec073b248da05e999e.zip
nginx-0.0.2-2004-02-11-20:08:49 import
Diffstat (limited to 'src/core/ngx_alloc.c')
-rw-r--r--src/core/ngx_alloc.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c
index dff05936e..ae96564fc 100644
--- a/src/core/ngx_alloc.c
+++ b/src/core/ngx_alloc.c
@@ -12,9 +12,7 @@ void *ngx_alloc(size_t size, ngx_log_t *log)
"malloc() %d bytes failed", size);
}
-#if (NGX_DEBUG_ALLOC)
- ngx_log_debug(log, "malloc: %08x:%d" _ p _ size);
-#endif
+ ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "malloc: %08x:%d", p, size);
return p;
}
@@ -57,27 +55,30 @@ void ngx_destroy_pool(ngx_pool_t *pool)
ngx_pool_large_t *l;
for (l = pool->large; l; l = l->next) {
-#if (NGX_DEBUG_ALLOC)
- ngx_log_debug(pool->log, "free: %08x" _ l->alloc);
-#endif
+
+ ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0,
+ "free: %08x", l->alloc);
+
if (l->alloc) {
free(l->alloc);
}
}
+#if (NGX_DEBUG)
+
/*
- * we could allocate pool->log from this pool
- * so we can not use this log while free()ing the pool
+ * we could allocate the pool->log from this pool
+ * so we can not use this log while the free()ing the pool
*/
-#if (NGX_DEBUG_ALLOC)
for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
- ngx_log_debug(pool->log, "free: %08x" _ p);
+ ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0, "free: %08x", p);
if (n == NULL) {
break;
}
}
+
#endif
for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
@@ -177,9 +178,8 @@ void ngx_pfree(ngx_pool_t *pool, void *p)
for (l = pool->large; l; l = l->next) {
if (p == l->alloc) {
-#if (NGX_DEBUG_ALLOC)
- ngx_log_debug(pool->log, "free: %08x" _ l->alloc);
-#endif
+ ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0,
+ "free: %08x", l->alloc);
free(l->alloc);
l->alloc = NULL;
}