Skip to content

Instantly share code, notes, and snippets.

@texel
Created July 21, 2010 17:39
Show Gist options
  • Save texel/484823 to your computer and use it in GitHub Desktop.
Save texel/484823 to your computer and use it in GitHub Desktop.
#include "ruby.h"
VALUE ValuePrinter = Qnil;
void Init_value_printer();
VALUE method_inspect_bytes(VALUE object);
void Init_value_printer() {
ValuePrinter = rb_define_module("ValuePrinter");
rb_define_method(ValuePrinter, "inspect_bytes", method_inspect_bytes, 0);
}
VALUE method_inspect_bytes(VALUE object) {
printf("%p\n", (void *)object);
return Qnil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment