Skip to content

Instantly share code, notes, and snippets.

@nishio
Created August 16, 2010 00:52
Show Gist options
  • Save nishio/526180 to your computer and use it in GitHub Desktop.
Save nishio/526180 to your computer and use it in GitHub Desktop.
--- object.c (revision 28993)
+++ object.c (working copy)
@@ -1542,7 +1542,21 @@
rb_class_new_instance(int argc, VALUE *argv, VALUE klass)
{
VALUE obj;
+ char* s;
+ if((s = getenv("RUBY_VERBOSE")) && strcmp(s, "")){
+ printf("rb_class_new_instance: %s(", rb_class2name(klass));
+ int i;
+ VALUE str;
+ const char* arg;
+ for(i=0; i < argc; i++){
+ str = rb_inspect(argv[i]);
+ arg = StringValueCStr(str);
+ printf("%s, ", arg);
+ }
+ printf(")\n");
+ }
+
obj = rb_obj_alloc(klass);
rb_obj_call_init(obj, argc, argv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment