ext: reduce frozen string marking overhead
commit029d072d420f0adf98c620913fe05eba3222e244
authorEric Wong <e@80x24.org>
Tue, 17 Jan 2017 19:34:25 +0000 (17 19:34 +0000)
committerEric Wong <e@80x24.org>
Wed, 15 Feb 2017 22:28:21 +0000 (15 22:28 +0000)
tree69c1fe46cff76ccb7997c1bc8c801ab047338cba
parente9baac1c4f912d6394b021af9037441b1602f431
ext: reduce frozen string marking overhead

Using rb_global_variable excessively can be expensive since it
uses a singly-linked list to track addresses.  Since these
strings are all frozen and constant, put them into an array
instead and only mark the array as a global to improve locality.

Ruby 1.9+ has rb_gc_register_mark_object but it is
not part of the documented, public API, so we're not
using it, yet.
ext/clogger_ext/clogger.c