Forum: Ruby-core [ruby-trunk - Feature #8684][Open] GC.disable with block

C042517d59bed4761cc88681bf71fca8?d=identicon&s=25 Glass_saga (Masaki Matsushita) (Guest)
on 2013-07-25 13:40
(Received via mailing list)
Issue #8684 has been reported by Glass_saga (Masaki Matsushita).

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

Author: Glass_saga (Masaki Matsushita)
Status: Open
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
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 matz (Yukihiro Matsumoto) (Guest)
on 2013-07-25 17:22
(Received via mailing list)
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
This topic is locked and can not be replied to.