Previously the code would pass vm_ (ie, the main thread that the handler wakes up) into things like Channel::send as the state argument, which is not allowed. By creating a normal Thread, we'v got a unique VM* to use just for the handler.
The expected size was generated by the following Ruby program running under Ruby 1.8.7-p352: require 'stringio' require 'zlib' io = StringIO.new input = '.' * (2 ** 23) Zlib::GzipWriter.wrap(io) do |gzio| gzio.write(input) end print io.string This program was then run: $ ruby gen.rb | wc -c 8176 References #1185.
MRI allows for creating a very strange object that has no klass pointer set. This means this object can't for example be inspected, since it will given the following result: NotImplementedError: method `class' called on terminated object (0xXXXXXXXX) In Rubinius we just use Object, so it at least works. It is definitely recommended to use a proper actual class to prevent potential issues on MRI. Fixes #1187
Baker::check_finalize checks if an object is forwarded to know if it has still alive or not therefore whether or not run it's finalizer. Therefore we can not check finalizers more than once because the 2nd time, we'll see objects that we have fixed up (and therefore are not forwarded) and finalizer them.