DESCRIPTION

src/pmc/managedstruct.pmc - Memory-managed C struct

DESCRIPTION

ManagedStruct extends UnManagedStruct to provide a class to hold C struct values that Parrot is responsible for disposing of.

Methods

void init()
Initializes an empty struct.
void init_pmc(PMC *value)
Initializes the struct with *value.
void destroy()
Destroys the struct, freeing the allocated memory.If the "custom_free_func" attribute is set, it is called to free the pointer. Otherwise, mem_sys_free() is used.
void set_integer_native(INTVAL value)
(Re)allocates value bytes for the struct.
PMC *clone()
Creates a clone of this PMC; clones any unmanaged memory it holds too.If the "custom_clone_func" attribute is set, it is called to clone the PMC. Otherwise, a basic (shallow copy) clone is performed, as there's no general way of knowing how to make a deep copy of the pointer contents.

HISTORY

Initial revision by sean 2002/08/04.