Project

General

Profile

Feature #8684

GC.disable with block

Added by Glass_saga (Masaki Matsushita) over 4 years ago. Updated over 4 years ago.

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

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 (792 Bytes) patch.diff Glass_saga (Masaki Matsushita), 07/25/2013 08:40 PM

History

#1 [ruby-core:56170] Updated by matz (Yukihiro Matsumoto) over 4 years 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