On Friday 17 August 2007 06:59:27 Steve Peters wrote: > The attached patch cleans up some problems with C++ compiling currently > with Parrot.
This patch has most of the cleanups while not segfaulting, at least on x86 Linux with GCC 4.1.2. -- c
=== src/gc/smallobject.c ================================================================== --- src/gc/smallobject.c (revision 5347) +++ src/gc/smallobject.c (local) @@ -202,22 +202,22 @@ NOTNULL(Small_Object_Arena *arena)) { UINTVAL i; - void *object; + PObj *object; UINTVAL num_objects = pool->objects_per_alloc; pool->total_objects += num_objects; arena->used = num_objects; /* Move all the new objects into the free list */ - object = (PObj *)((char *)arena->start_objects); + object = (PObj *)arena->start_objects; for (i = 0; i < num_objects; i++) { - PObj_flags_SETTO((PObj *)object, PObj_on_free_list_FLAG); + PObj_flags_SETTO(object, PObj_on_free_list_FLAG); /* * during GC buflen is used to check for objects on the * free_list */ - PObj_buflen((PObj*)object) = 0; + PObj_buflen(object) = 0; pool->add_free_object(interp, pool, object); object = (PObj *)((char *)object + pool->object_size); }