Issue #8684 has been updated by matz (Yukihiro Matsumoto).

Status changed from Open to Rejected

It's easily done by

  begin
    GC.disable
    do_something
  ensure
    GC.enable
  end

and considering block scoping doesn't work well with threads, I don't think it's worth to add as a built-in.

Matz.

----------------------------------------
Feature #8684: GC.disable with block
https://bugs.ruby-lang.org/issues/8684#change-40663

Author: Glass_saga (Masaki Matsushita)
Status: Rejected
Priority: Normal
Assignee: 
Category: core
Target version: current: 2.1.0


I propose GC.disable with block.
It is useful to ensure GC.enable.

usage:

GC.disable do
  do_something # GC disabled
end
# GC enabled


-- 
http://bugs.ruby-lang.org/