Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Extend the REPR API a little in preparation for supporting inlining o…
…f more complex types in objects. Most immediately this is for bigint support, but it's also the basis for compact structs, and later compact arrays and nested structs in NCI.
  • Loading branch information
jnthn committed Oct 28, 2011
1 parent d548c21 commit bcf7a04
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/6model/sixmodelobject.h
Expand Up @@ -146,6 +146,13 @@ struct SixModel_REPROps {
/* Creates a new instance based on the type object. */
PMC * (*instance_of) (PARROT_INTERP, PMC *WHAT);

/* Creates a new instance, but with its state based on data
* to be found at the specified address. This is used for
* making boxed versions of objects stored "flat" inside of
* others. Note that it must always copy the data from the
* source address, not point to that piece of memory. */
PMC * (*box_from) (PARROT_INTERP, PMC *WHAT, void *src);

/* Checks if a given object is defined (from the point of
* view of the representation). */
INTVAL (*defined) (PARROT_INTERP, PMC *Obj);
Expand All @@ -162,6 +169,10 @@ struct SixModel_REPROps {
/* Gets the current value for a native str attribute. */
STRING * (*get_attribute_str) (PARROT_INTERP, PMC *Object, PMC *ClassHandle, STRING *Name, INTVAL Hint);

/* Gets a reference to the memory location of an attribute. Note
* that this is only valid so long as the object itself is alive. */
void * (*get_attribute_ref) (PARROT_INTERP, PMC *Object, PMC *ClassHandle, STRING *Name, INTVAL Hint);

/* Binds the given object value to the specified attribute. */
void (*bind_attribute) (PARROT_INTERP, PMC *Object, PMC *ClassHandle, STRING *Name, INTVAL Hint, PMC *Value);

Expand Down

0 comments on commit bcf7a04

Please sign in to comment.