From: Tridib Bandopadhyay Date: 2010-12-07T11:19:05+09:00 Subject: Re: Manual Memory Management and Automatic Garbage Collection Jeremy Bopp wrote in post #966541: > Have you tried sprinkling some printf statements throughout gc.c > yourself yet? If the diagnostic instrumentation for gc.c is hard to > find or does not exist, adding your own can at least help you make some > progress. > > To start, you could add a printf with the function name at the beginning > of each function in gc.c. Then run your build of ruby with your test > scripts to trigger garbage collection and see what gets printed. That > should give you a lead on where to add more printf calls to gc.c in > order to gather more detailed information. > > -Jeremy Yes I have tried that long back.. for example in this code fragment-- VALUE rb_newobj() { VALUE obj; printf("newobj"); /*My own line*/ if (!freelist) garbage_collect(); obj = (VALUE)freelist; freelist = freelist->as.free.next; MEMZERO((void*)obj, RVALUE, 1); #ifdef GC_DEBUG RANY(obj)->file = ruby_sourcefile; RANY(obj)->line = ruby_sourceline; #endif return obj; } But when I am making this change and trying to compile my ruby. It is bombing out with a message Segmentation failure and it is printing my print statement numerous times before bombing out.I also tried in my other functions. Also can you tell me when we compile the ruby with 'make' command how does it changes the gc.c file in the executable file. -- Posted via http://www.ruby-forum.com/.