| parrotcode: A DOD Registry PMC | |
| Contents | PMCs |

src/pmc/addrregistry.pmc - A DOD Registry PMC

The AddrRegistry class provides the equivalence of reference counts mainly for extenders and embeders of Parrot. The hash keys are the addresses of the key PMC, values are reference counts, i.e. the difference of (set_pmc_keyed - delete_pmc_keyed). If the reference goes to zero, the entry is deleted physically.
Please note that you have to anchor an instance of AddrRegistry yourself with Parrot_register_pmc if it isn't visible to Parrot.

void init()void destroy()void mark()INTVAL get_integer_keyed(PMC *key)key or 0 if the key doesn't exist.INTVAL elements()INTVAL get_bool()void set_pmc_keyed(PMC *key, PMC *value)key.
If the entry doesn't exist create it.
The value is always ignored.void set_integer_keyed(PMC *key, INTVAL value)void delete_keyed(PMC *key)key.
If the reference count reaches 0,
delete the entry.PMC *get_iter ()PMC *get_pmc_keyed(PMC *key)
src/pmc.c:dod_register_pmc()
|
|
|