What about extending object's memory representaion. Like adding some fields to RClass. rb_extend_value( VALUE Val, unsigned long extSize ); // relocates RClass structure pointed by Val. // Resizes it to be longer by extSize VALUES rb_get_value( VALUE Val, unsigned long offset ); // retrieves offset'th VALUE from the extension area. rb_set_value( VALUE Val, unsigned long offset, VALUE Val ); // set soffset'th VALUE to Val. This would help storing some data when creating class and instance variables does not suite.