apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/lib apr_pools.c
Date Fri, 05 Jan 2001 00:13:21 GMT
rbb         01/01/04 16:13:21

  Modified:    lib      apr_pools.c
  Log:
  Back out the changes to ALLOC_STATS that weren't ready yet.
  
  Revision  Changes    Path
  1.81      +0 -70     apr/lib/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/lib/apr_pools.c,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- apr_pools.c	2001/01/05 00:10:11	1.80
  +++ apr_pools.c	2001/01/05 00:13:21	1.81
  @@ -206,14 +206,6 @@
   #endif /* APR_POOL_DEBUG */
   
   #ifdef ALLOC_STATS
  -
  -typedef struct allocs {
  -    char *ploc;
  -    struct allocs *next;
  -} allocs;
  -
  -static allocs *top;
  -
   static unsigned long long num_free_blocks_calls;
   static unsigned long long num_blocks_freed;
   static unsigned max_blocks_in_one_free;
  @@ -242,58 +234,6 @@
   #define debug_verify_filled(a,b,c)
   #endif /* ALLOC_DEBUG */
   
  -#ifdef ALLOC_STATS
  -
  -static void add_alloc_stats(union block_hdr *block)
  -{
  -    allocs *newadd = malloc(sizeof(*newadd));
  -
  -    newadd->ploc = block->h.first_avail;
  -fprintf(stderr, "adding:   %p\n", newadd->ploc);
  -    if (top) {
  -        newadd->next = top;
  -    }
  -    top = newadd;
  -}
  -
  -static void remove_allocs(union block_hdr *block)
  -{
  -    allocs *remove = top;
  -    allocs *rem2 = top;
  -
  -    while (remove && (remove->ploc != block->h.first_avail)) {
  -        remove = remove->next;
  -    }
  -
  -    if (!remove) {
  -        fprintf(stderr, "Trying to remove memory that was never added, %p?\n", block->h.first_avail);
  -        fflush(stderr);
  -    }
  -    else if (remove == top) {
  -        top = top->next;
  -        free(remove);
  -    }
  -    else {
  -        while (rem2->next != remove) {
  -            rem2 = rem2->next;
  -        }
  -        rem2->next = remove->next;
  -        free(remove);
  -    }      
  -}
  -
  -static void dump_allocs(void)
  -{
  -    allocs *foo = top;
  -
  -    while (foo) {
  -        fprintf(stderr, "%p ", foo->ploc);
  -        foo = foo->next;
  -    }
  -    fprintf(stderr, "\n");
  -}
  -#endif
  -
   /*
    * Get a completely new block from the system pool. Note that we rely on
    * malloc() to provide aligned memory.
  @@ -334,10 +274,6 @@
       blok->h.owning_pool = NULL;
   #endif /* APR_POOL_DEBUG */
   
  -#ifdef ALLOC_STATS
  -    add_alloc_stats(blok);
  -#endif
  -
       return blok;
   }
   
  @@ -439,7 +375,6 @@
       }
       ++num_free_blocks_calls;
       num_blocks_freed += num_blocks;
  -    remove_allocs(blok);
   #endif /* ALLOC_STATS */
   
   #if APR_HAS_THREADS
  @@ -469,9 +404,6 @@
   	    debug_verify_filled(blok->h.first_avail, blok->h.endp,
   				"[new_block] Ouch!  Someone trounced a block "
   				"on the free list!\n");
  -#ifdef ALLOC_STATS
  -            add_alloc_stats(blok);
  -#endif
   	    return blok;
   	}
   	else {
  @@ -597,7 +529,6 @@
   	max_blocks_in_one_free,
   	num_malloc_calls,
   	num_malloc_bytes);
  -    dump_allocs();
   }
   #endif
   
  @@ -1360,4 +1291,3 @@
   	}
       }
   }
  -
  
  
  

Mime
View raw message