diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2006-04-04 12:50:03 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2006-04-04 12:50:03 +0000 |
commit | 1df01b2047d8c836f1ad07909c15a8a250840062 (patch) | |
tree | edb745aa26841b4b129a3914d0d0bb1af797bef9 /usr.sbin/httpd | |
parent | a320537a3225133c9f0884118d24b9d8beeb965d (diff) |
dead code removal
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r-- | usr.sbin/httpd/src/main/alloc.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/usr.sbin/httpd/src/main/alloc.c b/usr.sbin/httpd/src/main/alloc.c index 87f9e397287..e4fb1da7755 100644 --- a/usr.sbin/httpd/src/main/alloc.c +++ b/usr.sbin/httpd/src/main/alloc.c @@ -114,11 +114,6 @@ */ /* #define MAKE_TABLE_PROFILE */ -/* Provide some statistics on the cost of allocations. It requires a - * bit of an understanding of how alloc.c works. - */ -/* #define ALLOC_STATS */ - #ifdef POOL_DEBUG #ifdef ALLOC_USE_MALLOC # error "sorry, no support for ALLOC_USE_MALLOC and POOL_DEBUG at the same time" @@ -183,13 +178,6 @@ static int stack_direction; static union block_hdr *global_block_list; #define FREE_POOL ((struct pool *)(-1)) #endif -#ifdef ALLOC_STATS -static unsigned long long num_free_blocks_calls; -static unsigned long long num_blocks_freed; -static unsigned max_blocks_in_one_free; -static unsigned num_malloc_calls; -static unsigned num_malloc_bytes; -#endif #ifdef ALLOC_DEBUG #define FILL_BYTE ((char)(0xa5)) @@ -232,10 +220,6 @@ static union block_hdr *malloc_block(int size) */ size += CLICK_SZ; #endif -#ifdef ALLOC_STATS - ++num_malloc_calls; - num_malloc_bytes += size + sizeof(union block_hdr); -#endif request_size = size + sizeof(union block_hdr); #if defined(EAPI_MM) if (is_shm) @@ -299,9 +283,6 @@ static void free_blocks(union block_hdr *blok) free(blok); } #else -#ifdef ALLOC_STATS - unsigned num_blocks; -#endif /* First, put new blocks at the head of the free list --- * we'll eventually bash the 'next' pointer of the last block * in the chain to point to the free blocks we already had. @@ -326,13 +307,7 @@ static void free_blocks(union block_hdr *blok) * now. */ -#ifdef ALLOC_STATS - num_blocks = 1; -#endif while (blok->h.next != NULL) { -#ifdef ALLOC_STATS - ++num_blocks; -#endif chk_on_blk_list(blok, old_free_list); blok->h.first_avail = (char *) (blok + 1); debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); @@ -353,14 +328,6 @@ static void free_blocks(union block_hdr *blok) blok->h.next = old_free_list; -#ifdef ALLOC_STATS - if (num_blocks > max_blocks_in_one_free) { - max_blocks_in_one_free = num_blocks; - } - ++num_free_blocks_calls; - num_blocks_freed += num_blocks; -#endif - (void) ap_release_mutex(alloc_mutex); #if defined(EAPI_MM) if (blok->h.is_shm) @@ -569,20 +536,6 @@ int ap_shared_pool_possible(void) return ap_mm_useable(); } -#ifdef ALLOC_STATS -static void dump_stats(void) -{ - fprintf(stderr, - "alloc_stats: [%d] #free_blocks %llu #blocks %llu max %u #malloc %u #bytes %u\n", - (int)getpid(), - num_free_blocks_calls, - num_blocks_freed, - max_blocks_in_one_free, - num_malloc_calls, - num_malloc_bytes); -} -#endif - API_EXPORT(pool *) ap_init_alloc(void) { #ifdef POOL_DEBUG @@ -594,10 +547,6 @@ API_EXPORT(pool *) ap_init_alloc(void) alloc_mutex = ap_create_mutex(NULL); spawn_mutex = ap_create_mutex(NULL); permanent_pool = ap_make_sub_pool(NULL); -#ifdef ALLOC_STATS - atexit(dump_stats); -#endif - return permanent_pool; } |