From 8940922d1889f885d4f26b4c815beb136a9a2095 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sun, 7 Jan 2024 14:26:10 -0500 Subject: [PATCH] [DOC] Improve doc for GC.latest_compact_info --- gc.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/gc.c b/gc.c index 372274959e..1150f1794d 100644 --- a/gc.c +++ b/gc.c @@ -11002,11 +11002,19 @@ gc_update_references(rb_objspace_t *objspace) * * Returns information about object moved in the most recent \GC compaction. * - * The returned hash has two keys :considered and :moved. The hash for - * :considered lists the number of objects that were considered for movement - * by the compactor, and the :moved hash lists the number of objects that - * were actually moved. Some objects can't be moved (maybe they were pinned) - * so these numbers can be used to calculate compaction efficiency. + * The returned +hash+ has the following keys: + * + * - +:considered+: a hash containing the type of the object as the key and + * the number of objects of that type that were considered for movement. + * - +:moved+: a hash containing the type of the object as the key and the + * number of objects of that type that were actually moved. + * - +:moved_up+: a hash containing the type of the object as the key and the + * number of objects of that type that were increased in size. + * - +:moved_down+: a hash containing the type of the object as the key and + * the number of objects of that type that were decreased in size. + * + * Some objects can't be moved (due to pinning) so these numbers can be used to + * calculate compaction efficiency. */ static VALUE gc_compact_stats(VALUE self)