NAME

src/pmc/sharedref.pmc - Shared PMC Reference

DESCRIPTION

The vtable functions for the SharedRef base class.

This class wraps locking around PMC access.

All methods not present below get a default body autogenerated inside Parrot::Pmc2c.

Currently all access is locked. When we have a non-copying GC allocator we can relax that a bit.

Methods

void init_pmc(PMC *init)
Initialize the shared reference.TODO - If the PMC we refer to is an aggregate (or has properties) then:
  • call share() on the aggregate, which calls share() on its contents - so getting aggregate members only yields shared PMCs
  • and unshare the aggregate itself, because we lock on behalf of the referee
A direct dereference of the SharedRef is currently not enabled so we shouldn't leak unshared PMCs into different threads.
void share()
We already share, so just ignore.
void mark()
Marks the reference as live.
void set_pmc(PMC *other)
Sets the referenced PMC to *other.
PMC *get_pmc()
Catch dereferencing. This would unshare the referred PMC.
void destroy()
Destroys the referred object and itself. This probably needs destroy ordering or at least a detection if the referred PMC is already destroyed.

HISTORY

Initial revision by leo 2004.01.14.