I am trying to write a PMC version of PGE::CodeString, and while I
have a PMC now that passes all the old tests, I get GC errors during
the build process for TGE & JSON.
I know they are GC related because running the affected steps with -
G, and they complete normally.
I was unable to find a document describing what sorts of things I
needed to do; Working with particle (on GC) and allison (on storage),
I now have:
void init() {
PMC* counter;
PMC_str_val(SELF) =
string_make_empty(INTERP, enum_stringrep_one, 0);
PObj_custom_mark_SET(SELF);
/* initialized our counter that keeps track of register
numbers */
counter = pmc_new(INTERP, enum_class_Integer);
VTABLE_set_integer_native(INTERP, counter, 10);
PMC_data(SELF) = counter;
}
and
void mark() {
if (PMC_str_val(SELF))
pobject_lives(INTERP, (PObj *)PMC_str_val(SELF));
if (PMC_data(SELF))
pobject_lives(INTERP, (PObj *) PMC_data(SELF));
}
Does that look at all reasonable?
However, the following command:
../../parrot ../../compilers/pge/pgc.pir --output=TGE/Parser.pir TGE/
Parser.pg
results in:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000a
0x0000a59f in pobject_lives (interp=0x31003b0, obj=0x2) at src/gc/
dod.c:168
168 if (PObj_is_live_or_free_TESTALL(obj)) {
(gdb) bt
#0 0x0000a59f in pobject_lives (interp=0x31003b0, obj=0x2) at src/gc/
dod.c:168
#1 0x00030904 in mark_context (interp=0x31003b0, ctx=0x313f1c0) at
src/sub.c:69
#2 0x001755fd in Parrot_Continuation_mark (interp=0x31003b0,
pmc=0x186d4e8) at ./src/pmc/continuation.pmc:89
#3 0x0000ac13 in Parrot_dod_trace_children (interp=0x31003b0,
how_many=4294966916) at src/gc/dod.c:440
#4 0x0000a978 in trace_active_PMCs (interp=0x31003b0, trace_stack=1)
at src/gc/dod.c:360
#5 0x0000b643 in Parrot_dod_ms_run (interp=0x31003b0, flags=1) at
src/gc/dod.c:1002
#6 0x0000b72e in Parrot_do_dod_run (interp=0x31003b0, flags=1) at
src/gc/dod.c:1052
...
--
Will "Coke" Coleda
[EMAIL PROTECTED]