Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tag the REPR function table with the ID the REPR gets, so it's conven…
…iently available.
  • Loading branch information
jnthn committed Nov 8, 2011
1 parent 102de40 commit 006974d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/6model/repr_registry.c
Expand Up @@ -35,6 +35,7 @@ static void register_repr(PARROT_INTERP, STRING *name, REPROps *repr) {
repr_registry = mem_sys_allocate(num_reprs * sizeof(REPROps *));
repr_registry[ID] = repr;
VTABLE_set_integer_keyed_str(interp, repr_name_to_id_map, name, ID);
repr->ID = ID;
}

/* Dynamically registers a representation (that is, one defined outside of
Expand Down
3 changes: 3 additions & 0 deletions src/6model/sixmodelobject.h
Expand Up @@ -258,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 Down

0 comments on commit 006974d

Please sign in to comment.