NAME ^

src/pmc.c - The base vtable calling functions

DESCRIPTION ^

Functions ^

PMC *pmc_new(Interp *interpreter, INTVAL base_type)

Creates a new PMC of type base_type (which is an index into the list of PMC types declared in Parrot_base_vtables in include/parrot/pmc.h). Once the PMC has been successfully created and its vtable pointer initialized, we call its init method to perform any other necessary initialization.

PMC *pmc_reuse(Interp *interpreter, PMC *pmc, INTVAL new_type, UINTVAL flags)

Reuse an existing PMC, turning it into an empty PMC of the new type. Any required internal structure will be put in place (such as the extension area) and the PMC will be ready to go. This will throw an exception if the PMC is constant or of a singleton type (such as the environment PMC) or is being turned into a PMC of a singleton type.

static PMC *get_new_pmc_header(Interp *interpreter, INTVAL base_type, UINTVAL flags)

Gets a new PMC header.

PMC *pmc_new_noinit(Interp *interpreter, INTVAL base_type)

Creates a new PMC of type base_type (which is an index into the list of PMC types declared in Parrot_base_vtables in include/parrot/pmc.h). Unlike pmc_new(), pmc_new_noinit() does not call its init method. This allows separate allocation and initialization for continuations.

PMC *constant_pmc_new_noinit(Interp *interpreter, INTVAL base_type)

Creates a new constant PMC of type base_type.

PMC *constant_pmc_new(Interp *interpreter, INTVAL base_type)

Creates a new constant PMC of type base_type, the call init.

PMC *pmc_new_init(Interp *interpreter, INTVAL base_type, PMC *init)

As pmc_new(), but passes init to the PMC's init_pmc() method.

PMC *constant_pmc_new_init(Interp *interpreter, INTVAL base_type, PMC *init)

As constant_pmc_new, but passes init to the PMC's init_pmc method.

INTVAL pmc_register(Parrot_Interp interp, STRING *name)

This segment handles PMC registration and such.

INTVAL pmc_type(Parrot_Interp interp, STRING *name)

Returns the PMC type for name.

void Parrot_create_mro(Interp *interpreter, INTVAL type)

Create the MRO (method resolution order) array for this type.

static size_t key_hash_int(Interp *interp, Hash *hash, void *value)

Simply returns value. hash is ignored.

Used in dod_register_pmc().

static int int_compare(Parrot_Interp interp, void *a, void *b)

Returns whether a != b.

Used in dod_register_pmc().

DOD registry interface ^

void dod_register_pmc(Parrot_Interp interpreter, PMC *pmc)

Registers the PMC with the interpreter's DOD registery.

void dod_unregister_pmc(Parrot_Interp interpreter, PMC *pmc)

Unregisters the PMC from the interpreter's DOD registery.

SEE ALSO ^

include/parrot/vtable.h.

5.1.0.14.2.20011008152120.02158148@pop.sidhe.org (http://www.nntp.perl.org/group/perl.perl6.internals/5516).

HISTORY ^

Initial version by Simon on 2001.10.20.


parrot