mruby/mruby — pull request #696 by authorNari (2013-01-06 16:52:56+00:00)
Title: Generational Garbage Collection for mruby

HAPPY NEW YEAR!

I've impelemented a generational GC mode for mruby.

This patch introduce ``GC.generational_mode=``.
If you set ``true`` mruby's collector change to the generational mode.
(its default value is ``true`` at this time, so we will usually use the gen mode).

The major GC performs incrementally.
This is a different point from Lua's GC.

I've measured total GC time of normal and gen mode when executes the following code.

```ruby
# normal or gen mode
# GC.generational_mode = false
a = []
100_000.times do |i|
a << i.to_s
end

100.times do
a.each do |i|
i.dup
end
end
```

Result:

normal: 0.65294(sec)
gen mode: 0.31575(sec)

Thanks!