Skip to content

Commit

Permalink
[OO] Added object attribute storage initialization.
Browse files Browse the repository at this point in the history
This presized cache avoids the need to allocate (and re-allocate) storage for
object attributes on access. It's a small improvement until a unified
object-and-storage strategy exists.
  • Loading branch information
chromatic committed Sep 8, 2011
1 parent a23acf4 commit 7b8bf15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pmc/class.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,9 @@ Creates a new PMC object of the type of the class and calls init().
Parrot_Object_attributes * const objattr =
PMC_data_typed(object, Parrot_Object_attributes *);
objattr->_class = SELF;
objattr->attrib_store = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
objattr->attrib_store =
Parrot_pmc_new_init_int(INTERP, enum_class_ResizablePMCArray,
VTABLE_elements(INTERP, _class->attrib_index));
PARROT_GC_WRITE_BARRIER(INTERP, object);
}

Expand Down

0 comments on commit 7b8bf15

Please sign in to comment.