Feature #8684

GC.disable with block

Added by Masaki Matsushita 9 months ago. Updated 9 months ago.

[ruby-core:56168]
Status:Rejected
Priority:Normal
Assignee:-
Category:core
Target version:2.1.0

Description

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

usage:

GC.disable do
do_something # GC disabled
end

GC enabled

patch.diff Magnifier (792 Bytes) Masaki Matsushita, 07/25/2013 08:40 PM

History

#1 Updated by Yukihiro Matsumoto 9 months ago

  • 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.

Also available in: Atom PDF