NAME
src/pmc.c - The base vtable calling functions
DESCRIPTION
Functions
INTVAL PMC_is_null
Tests if the given pmc is null.
PMC *pmc_new
Creates a new PMC of type PMC *pmc_reuse
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
Gets a new PMC header.
PMC *pmc_new_noinit
Creates a new PMC of type PMC *constant_pmc_new_noinit
Creates a new constant PMC of type PMC *constant_pmc_new
Creates a new constant PMC of type PMC *pmc_new_init
As PMC *constant_pmc_new_init
As PMC *temporary_pmc_new
Creates a new temporary PMC of type void temporary_pmc_free
Frees a new temporary PMC created by INTVAL pmc_register
Registers the name of a new PMC type with Parrot,
returning the INTVAL representing that type.
INTVAL pmc_type
Returns the PMC type for INTVAL pmc_type_p
Returns the PMC type for static PMC *create_class_pmc
Create a class object for this interpreter.
Takes an interpreter name and type as arguments.
Returns a pointer to the class object.
void Parrot_create_mro
Create the MRO (method resolution order) array for this type.
base_type
(which is an index into the list of PMC types declared in 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.
base_type
(which is an index into the list of PMC types declared in 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.
base_type
.
base_type
,
then calls its init
.
pmc_new()
,
but passes init
to the PMC's init_pmc()
vtable entry.
constant_pmc_new
,
but passes init
to the PMC's init_pmc
vtable entry.
base_type
,
the call init
.
You are responsible for freeing this PMC when it goes out of scope with free_temporary_pmc()
.
Do not store this PMC in any other PMCs,
or allow it to be stored.
Do not store any regular PMC in this PMC,
or allow the storage of any regular PMC in this PMC.If you don't know what this means means,
or you can't tell if either case will happen as the result of any call you make on or with this PMC,
DO NOT use this function,
lest you cause weird crashes and memory errors.
Use pmc_new()
instead.(Why do these functions even exist?
Used judiciously,
they can reduce GC pressure in hotspots tremendously.
If you haven't audited the code carefully -- including profiling and benchmarking -- then use pmc_new()
instead,
and never ever add PARROT_EXPORT
to either function.)
temporary_pmc_new()
.
Do not call this with any other type of PMC.
Do not forget to call this (or you'll leak PMCs).
Read and understand the warnings for temporary_pmc_new()
before you're tempted to use this.
name
.
name
.
GC registry interface
void gc_register_pmc
Registers the PMC with the interpreter's GC registry.
void gc_unregister_pmc
Unregisters the PMC from the interpreter's GC registry.
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.