Author: Whiteknight
Date: Mon Aug 18 14:04:11 2008
New Revision: 30312
Modified:
branches/gsoc_pdd09/src/gc/gc_it.c
Log:
[gsoc_pdd09] add patch from chromatic++ that helps prevent garbage from being
needlessly inserted into newly-created PMCs. Also, remove a defunct comment.
Modified: branches/gsoc_pdd09/src/gc/gc_it.c
==============================================================================
--- branches/gsoc_pdd09/src/gc/gc_it.c (original)
+++ branches/gsoc_pdd09/src/gc/gc_it.c Mon Aug 18 14:04:11 2008
@@ -1095,18 +1095,17 @@
void
gc_it_alloc_objects(PARROT_INTERP, ARGMOD(struct Small_Object_Pool *pool))
{
- const size_t object_size = pool->object_size;
+ const size_t object_size = pool->object_size;
const size_t objects_per_alloc = pool->objects_per_alloc;
+
/* The size of the allocated arena. This is the size of the
Small_Object_Arena structure, which goes at the front, the card, and
the objects. */
const size_t arena_size = (object_size * objects_per_alloc)
+ sizeof (Small_Object_Arena);
Small_Object_Arena * const new_arena =
- (Small_Object_Arena *)mem_internal_allocate(arena_size);
+ (Small_Object_Arena *)mem_internal_allocate_zeroed(arena_size);
- /* The objects are packed in after the cards (and any alignment space that
- we've added). */
new_arena->total_objects = objects_per_alloc;
new_arena->start_objects = (void *)(((char *)new_arena) + sizeof
(Small_Object_Arena));