Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bump to latest 6model API.
  • Loading branch information
jnthn committed Nov 8, 2011
1 parent d2d14a2 commit dd61d0e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/binder/sixmodelobject.h
Expand Up @@ -222,6 +222,11 @@ struct SixModel_REPROps {
* can hold one. */
STRING * (*get_str) (PARROT_INTERP, STable *st, void *data);

/* Some objects serve primarily as boxes of others, inlining them. This gets
* gets the reference to such things, using the representation ID to distinguish
* them. */
void * (*get_boxed_ref) (PARROT_INTERP, STable *st, void *data, INTVAL repr_id);

/* This Parrot-specific addition to the API is used to mark an object. */
void (*gc_mark) (PARROT_INTERP, STable *st, void *data);

Expand Down Expand Up @@ -253,6 +258,9 @@ struct SixModel_REPROps {
* out, the representation probably knows more about timing issues and
* thread safety requirements. */
void (*change_type) (PARROT_INTERP, PMC *Object, PMC *NewType);

/* The representation's ID. */
INTVAL ID;
};

/* Hint value to indicate the absence of an attribute lookup or method
Expand All @@ -279,4 +287,12 @@ PMC * wrap_object(PARROT_INTERP, void *obj);
PMC * create_stable(PARROT_INTERP, REPROps *REPR, PMC *HOW);
PMC * decontainerize(PARROT_INTERP, PMC *var);

/* Dynamic representation registration. */
typedef INTVAL (* rf) (PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, void *, void *));
#define REGISTER_DYNAMIC_REPR(interp, name, reg_func) \
((rf) \
VTABLE_get_pointer(interp, \
VTABLE_get_pmc_keyed_str(interp, interp->root_namespace, \
Parrot_str_new_constant(interp, "_REGISTER_REPR"))))(interp, name, reg_func)

#endif

0 comments on commit dd61d0e

Please sign in to comment.