ender672/nokogiri — comment on commit bd62219eed78a29126b5d346bba670cd42b57cd4
File: ext/nokogiri/xml_sax_parser.c line 14
By ender672:

In this case I simplified the internal data structure by getting rid of a struct entirely (though you're right -- normally, you have to add a struct for the rb_gc_mark approach):
https://github.com/ender672/nokogiri/commit/bd62219eed78a29126b5d346bba670cd42b57cd4#L8L10

I have this OCD thing where it irks me when ruby land can segfault the interpreter, no matter how silly it has to be to accomplish this. Using instance variables to prevent GC usually means that ruby land can cause a segfault.

I've noticed that ruby core tends to be rock solid about this, and when I found some pretty obscure corner cases that could crash the interpreter, they fixed the issue.