OSDN Git Service

gcc
[pf3gnuchains/gcc-fork.git] / gcc / alloc-pool.c
index d85cd9e..0a58f37 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions to support a pool of allocatable objects.
-   Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+   Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    Contributed by Daniel Berlin <dan@cgsoftware.com>
 
@@ -292,11 +292,11 @@ pool_free (alloc_pool pool, void *ptr)
   gcc_assert (ptr);
 
 #ifdef ENABLE_CHECKING
-  memset (ptr, 0xaf, pool->elt_size - offsetof (allocation_object, u.data));
-
   /* Check whether the PTR was allocated from POOL.  */
   gcc_assert (pool->id == ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id);
 
+  memset (ptr, 0xaf, pool->elt_size - offsetof (allocation_object, u.data));
+
   /* Mark the element to be free.  */
   ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id = 0;
 #else
@@ -339,7 +339,8 @@ print_statistics (void **slot, void *b)
 #endif
 
 /* Output per-alloc_pool memory usage statistics.  */
-void dump_alloc_pool_statistics (void)
+void
+dump_alloc_pool_statistics (void)
 {
 #ifdef GATHER_STATISTICS
   struct output_info info;