Skip to content

Commit 1267a3a

Browse files
committed
[DOC] Improve docs for ObjectSpace.count_imemo_objects
1 parent cf5c5ab commit 1267a3a

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

ext/objspace/objspace.c

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -419,28 +419,22 @@ count_imemo_objects_i(VALUE v, void *data)
419419

420420
/*
421421
* call-seq:
422-
* ObjectSpace.count_imemo_objects([result_hash]) -> hash
422+
* ObjectSpace.count_imemo_objects(result_hash = nil) -> hash
423423
*
424-
* Counts objects for each +T_IMEMO+ type.
424+
* Returns a hash containing the number of objects for each +T_IMEMO+ type.
425+
* The keys are Symbol objects of the +T_IMEMO+ type name.
426+
* +T_IMEMO+ objects are Ruby internal objects that are not visible to Ruby
427+
* programs.
425428
*
426-
* This method is only for MRI developers interested in performance and memory
427-
* usage of Ruby programs.
428-
*
429-
* It returns a hash as:
429+
* ObjectSpace.count_imemo_objects
430+
* # => {imemo_callcache: 5482, imemo_constcache: 1258, imemo_ment: 13906, ... }
430431
*
431-
* {:imemo_ifunc=>8,
432-
* :imemo_svar=>7,
433-
* :imemo_cref=>509,
434-
* :imemo_memo=>1,
435-
* :imemo_throw_data=>1}
436-
*
437-
* If the optional argument, result_hash, is given, it is overwritten and
438-
* returned. This is intended to avoid probe effect.
439-
*
440-
* The contents of the returned hash is implementation specific and may change
441-
* in the future.
432+
* If the optional argument +result_hash+ is given, it is overwritten and
433+
* returned. This is intended to avoid the probe effect.
442434
*
443-
* In this version, keys are symbol objects.
435+
* This method is intended for developers interested in performance and memory
436+
* usage of Ruby programs. The contents of the returned hash is implementation
437+
* specific and may change in the future.
444438
*
445439
* This method is only expected to work with C Ruby.
446440
*/

0 commit comments

Comments
 (0)