Author: Whiteknight
Date: Tue Aug 12 18:40:11 2008
New Revision: 30200
Modified:
branches/gsoc_pdd09/src/gc/gc_it.c
branches/gsoc_pdd09/src/gc/smallobject.c
Log:
[gsoc_pdd09] resolved some of the more absurd errors (were between chair and
keyboard). Exposed some more devious errors.
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 Tue Aug 12 18:40:11 2008
@@ -1156,8 +1156,10 @@
Gc_it_hdr *p = (Gc_it_hdr *)new_arena->start_objects;
const size_t num_objs = new_arena->total_objects;
register size_t i;
+
PARROT_ASSERT(new_arena == pool->last_Arena);
- PARROT_ASSERT(contained_in_pool(pool, p));
+ PARROT_ASSERT((ptrdiff_t)p - (ptrdiff_t)new_arena->start_objects == 0);
+ PARROT_ASSERT(contained_in_pool(pool, IT_HDR_to_PObj(p)));
/* Here, we loop over the entire arena, finding the various object
headers and attaching them to the pool's free list. Each object
@@ -1167,11 +1169,12 @@
corresponds to the last flag on the last card. The very last object
in contrast corresponds to the very first flag on the first card. */
for (i = 0; i < num_objs; i++) {
+ PObj * pobj = IT_HDR_to_PObj(p);
Gc_it_hdr *next = (Gc_it_hdr *)((char*)p + pool->object_size);
/* Add the current item to the free list */
- PARROT_ASSERT(contained_in_pool(pool, p));
- gc_it_add_free_object(interp, pool, p);
+ PARROT_ASSERT(contained_in_pool(pool, pobj));
+ gc_it_add_free_object(interp, pool, pobj);
p->data.agg = 0;
p = next;
}
Modified: branches/gsoc_pdd09/src/gc/smallobject.c
==============================================================================
--- branches/gsoc_pdd09/src/gc/smallobject.c (original)
+++ branches/gsoc_pdd09/src/gc/smallobject.c Tue Aug 12 18:40:11 2008
@@ -98,7 +98,6 @@
const ptrdiff_t ptr_diff =
(ptrdiff_t)ptr - (ptrdiff_t)arena->start_objects;
- fprintf(stderr, "ptr_diff: %d\n", ptr_diff);
if (0 <= ptr_diff
# if PARROT_GC_IT
&& ptr_diff < (ptrdiff_t)(arena->total_objects *
pool->object_size)