src/pmc/managedstruct.pmc - ManagedStruct PMC


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


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_gc_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.