+2004-01-23 Jan Hubicka <jh@suse.cz>
+
+ * alloc-pool.c (align_four): Kill.
+ (create_alloc_pool): Align size to eight.
+ (free_alloc_pool, free_pool): Invalidate deallocated data.
+
2004-01-23 Ian Lance Taylor <ian@wasabisystems.com>
PR gcc/1532
ATTRIBUTE_NORETURN;
#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
-#define align_four(x) (((x+3) >> 2) << 2)
#define align_eight(x) (((x+7) >> 3) << 3)
/* The internal allocation object. */
size = sizeof (alloc_pool_list);
/* Now align the size to a multiple of 4. */
- size = align_four (size);
+ size = align_eight (size);
#ifdef ENABLE_CHECKING
/* Add the aligned size of ID. */
}
/* Lastly, free the pool and the name. */
free (pool->name);
+#ifdef ENABLE_CHECKING
+ memset (pool, 0xaf, sizeof (*pool));
+#endif
free (pool);
}
if (!ptr)
abort ();
+ memset (ptr, 0xaf, pool->elt_size - offsetof (allocation_object, u.data));
+
/* Check whether the PTR was allocated from POOL. */
if (pool->id != ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id)
abort ();