[DOC] Improve docs for GC.latest_compact_info

This commit is contained in:
Peter Zhu 2024-02-16 15:12:53 -05:00
parent 35fdf1a624
commit 97d4363d3b

22
gc.c
View File

@ -10897,16 +10897,20 @@ gc_update_references(rb_objspace_t *objspace)
* *
* Returns information about object moved in the most recent \GC compaction. * Returns information about object moved in the most recent \GC compaction.
* *
* The returned +hash+ has the following keys: * The returned +hash+ contains the following keys:
* *
* - +:considered+: a hash containing the type of the object as the key and * [considered]
* the number of objects of that type that were considered for movement. * Hash containing the type of the object as the key and the number of
* - +:moved+: a hash containing the type of the object as the key and the * objects of that type that were considered for movement.
* number of objects of that type that were actually moved. * [moved]
* - +:moved_up+: a hash containing the type of the object as the key and the * Hash containing the type of the object as the key and the number of
* number of objects of that type that were increased in size. * objects of that type that were actually moved.
* - +:moved_down+: a hash containing the type of the object as the key and * [moved_up]
* the number of objects of that type that were decreased in size. * 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]
* 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 * Some objects can't be moved (due to pinning) so these numbers can be used to
* calculate compaction efficiency. * calculate compaction efficiency.