Skip to content

Commit

Permalink
[gsoc_pdd09] flesh out this idea of duplicating flags (or possibly us…
Browse files Browse the repository at this point in the history
…ing one set in lieu of the other).

git-svn-id: https://svn.parrot.org/parrot/branches/gsoc_pdd09@30625 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Whiteknight authored and Whiteknight committed Aug 29, 2008
1 parent 5b430c7 commit 6372207
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/gc/gc_it.c
Expand Up @@ -1342,16 +1342,38 @@ gc_it_set_card_mark(ARGMOD(Gc_it_hdr *hdr), UINTVAL flag)
objects which are marked as being aggregates (and are therefore
isomorphic with Buffer *.
*/
/*
if(hdr->agg)
# ifdef GC_IT_USE_POBJ_FLAGS
if(hdr->agg) {
PObj * const p = IT_HDR_to_PObj(hdr);
switch (flag) {
/* This is relatively inefficient. I should be able to create
constant bitmaps for each condition and perform a logical
AND or OR to set them in a single operation. That's an
optimization to pursue later. */
case GC_IT_FLAG_BLACK:
PObj_live_SET(p);
PObj_is_fully_live_SET(p);
PObj_on_free_list_CLEAR(p);
break;
case GC_IT_FLAG_WHITE:
PObj_live_CLEAR(p);
PObj_is_fully_live_CLEAR(p);
PObj_on_free_list_CLEAR(p);
break;
case GC_IT_FLAG_GREY:
PObj_live_SET(p);
PObj_is_fully_live_CLEAR(p);
PObj_on_free_list_CLEAR(p);
break;
case CG_IT_FLAG_FREE:
PObj_live_CLEAR(p);
PObj_is_fully_live_CLEAR(p);
PObj_on_free_list_SET(p);
}
*/
}
# else
hdr->data.flag = flag;
# endif

}

Expand All @@ -1370,6 +1392,12 @@ PARROT_INLINE
UINTVAL
gc_it_get_card_mark(ARGMOD(Gc_it_hdr *hdr))
{
# ifdef GC_IT_USE_POBJ_FLAGS
/* Add the stuff here to check the PObj flags in the object, if it's an
aggregate. Get the data from the hdr->data.flag, and compare values
to make sure we have a sensical result (PARROR_ASSERT it). Return
the value if it's good. */
# endif
return hdr->data.flag;
}

Expand Down

0 comments on commit 6372207

Please sign in to comment.