ruby-changes:64251
From: Aaron <ko1@a...>
Date: Fri, 18 Dec 2020 06:28:14 +0900 (JST)
Subject: [ruby-changes:64251] 895b10ad02 (master): Add documentation about GC.compact
https://git.ruby-lang.org/ruby.git/commit/?id=895b10ad02 From 895b10ad020a788566c6e35431d07e6121e38c87 Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Thu, 17 Dec 2020 13:25:35 -0800 Subject: Add documentation about GC.compact [Misc #16443][ruby-core:96395] diff --git a/gc.rb b/gc.rb index 4e0faaf..8a00b40 100644 --- a/gc.rb +++ b/gc.rb @@ -198,6 +198,17 @@ module GC https://github.com/ruby/ruby/blob/trunk/gc.rb#L198 Primitive.gc_compact_stats end + # call-seq: + # GC.compact + # + # This function compacts objects together in Ruby's heap. It eliminates + # unused space (or fragmentation) in the heap by moving objects in to that + # unused space. This function returns a hash which contains statistics about + # which objects were moved. See `GC.latest_gc_info` for details about + # compaction statistics. + # + # This method is implementation specific and not expected to be implemented + # in any implementation besides MRI. def self.compact Primitive.gc_compact end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/