Mercurial > hg > nginx
comparison src/core/ngx_alloc.c @ 126:fcc79370b9a8
nginx-0.0.1-2003-08-06-18:43:50 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 06 Aug 2003 14:43:50 +0000 |
parents | 7db96f59bc29 |
children | 1947c683490f |
comparison
equal
deleted
inserted
replaced
125:885ffb8cc32a | 126:fcc79370b9a8 |
---|---|
57 ngx_log_debug(pool->log, "free: %08x" _ l->alloc); | 57 ngx_log_debug(pool->log, "free: %08x" _ l->alloc); |
58 #endif | 58 #endif |
59 free(l->alloc); | 59 free(l->alloc); |
60 } | 60 } |
61 | 61 |
62 for (p = pool, n = pool->next; /* void */; p = n, n = n->next) { | 62 /* we can use pool->log so we have to free() pool after all */ |
63 | |
64 for (p = pool->next; p ; p = n) { | |
63 #if (NGX_DEBUG_ALLOC) | 65 #if (NGX_DEBUG_ALLOC) |
64 ngx_log_debug(pool->log, "free: %08x" _ p); | 66 ngx_log_debug(pool->log, "free: %08x" _ p); |
65 #endif | 67 #endif |
68 n = p->next; | |
66 free(p); | 69 free(p); |
70 } | |
67 | 71 |
68 if (n == NULL) { | 72 #if (NGX_DEBUG_ALLOC) |
69 break; | 73 ngx_log_debug(pool->log, "free: %08x" _ pool); |
70 } | 74 #endif |
71 } | 75 free(pool); |
72 pool = NULL; | 76 pool = NULL; |
73 } | 77 } |
74 | 78 |
75 void *ngx_palloc(ngx_pool_t *pool, size_t size) | 79 void *ngx_palloc(ngx_pool_t *pool, size_t size) |
76 { | 80 { |