Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
use Parrot_gc_mark_PMC_alive & Parrot_gc_mark_STRING_alive
Browse files Browse the repository at this point in the history
(instead of Parrot_gc_mark_PObj_alive)
  • Loading branch information
fperrad committed Sep 25, 2009
1 parent 45ed019 commit d65c92e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/pmc/luafunction.pmc
Expand Up @@ -86,7 +86,7 @@ Marks the function as live.
VTABLE void mark() {
SUPER();
if (f_env(SELF))
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)f_env(SELF));
Parrot_gc_mark_PMC_alive(INTERP, f_env(SELF));
}

/*
Expand Down
8 changes: 3 additions & 5 deletions src/pmc/luastring.pmc
Expand Up @@ -49,8 +49,8 @@ Initializes the string.

*/
VTABLE void init() {
STRING *_str = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
SET_ATTR_str_val(INTERP, SELF, _str);
STRING *str_val = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
SET_ATTR_str_val(INTERP, SELF, str_val);
PObj_custom_mark_SET(SELF);
}

Expand Down Expand Up @@ -89,8 +89,7 @@ Marks the string as live.
VTABLE void mark() {
STRING * str_val;
GET_ATTR_str_val(INTERP, SELF, str_val);
if (str_val)
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)str_val);
Parrot_gc_mark_STRING_alive(INTERP, str_val);
}

/*
Expand All @@ -104,7 +103,6 @@ Creates a copy of the string.
*/
VTABLE PMC* clone() {
PMC * const res = pmc_new(INTERP, PMC_type(SELF));
PObj_custom_mark_destroy_SETALL(res);
VTABLE_set_string_native(INTERP, res, Parrot_str_copy(INTERP, SELF.get_string()));
return res;
}
Expand Down
6 changes: 3 additions & 3 deletions src/pmc/luatable.pmc
Expand Up @@ -357,9 +357,9 @@ static void lua_mark_table(PARROT_INTERP, LuaHash *t, STRING *mode)
for (i = 0; i < t->size; i++) {
if (v[i].val) {
if (mark_key)
Parrot_gc_mark_PObj_alive(interp, (PObj *)v[i].key);
Parrot_gc_mark_PMC_alive(interp, v[i].key);
if (mark_val)
Parrot_gc_mark_PObj_alive(interp, (PObj *)v[i].val);
Parrot_gc_mark_PMC_alive(interp, v[i].val);
}
}
}
Expand Down Expand Up @@ -422,7 +422,7 @@ Marks the hash as live.
lua_mark_table(INTERP, t_val(SELF), mode);

if (meta)
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)meta);
Parrot_gc_mark_PMC_alive(INTERP, meta);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions src/pmc/luathread.pmc
Expand Up @@ -92,9 +92,9 @@ Marks the Parrot::Coroutine as live.
*/
VTABLE void mark() {
if (t_val(SELF))
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)t_val(SELF));
Parrot_gc_mark_PMC_alive(INTERP, t_val(SELF));
if (t_env(SELF))
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)t_env(SELF));
Parrot_gc_mark_PMC_alive(INTERP, t_env(SELF));
}

/*
Expand Down
6 changes: 3 additions & 3 deletions src/pmc/luauserdata.pmc
Expand Up @@ -92,11 +92,11 @@ Marks the userdata as live.
*/
VTABLE void mark() {
if (u_val(SELF))
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)u_val(SELF));
Parrot_gc_mark_PMC_alive(INTERP, u_val(SELF));
if (u_env(SELF))
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)u_env(SELF));
Parrot_gc_mark_PMC_alive(INTERP, u_env(SELF));
if (u_mt(SELF))
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)u_mt(SELF));
Parrot_gc_mark_PMC_alive(INTERP, u_mt(SELF));
}

/*
Expand Down

0 comments on commit d65c92e

Please sign in to comment.