@@ -295,28 +295,27 @@ size_t rb_sym_immortal_count(void);
295295
296296/*
297297 * call-seq:
298- * ObjectSpace.count_symbols([ result_hash] ) -> hash
298+ * ObjectSpace.count_symbols(result_hash = nil ) -> hash
299299 *
300- * Counts symbols for each Symbol type.
300+ * Returns a hash containing the number of objects for each Symbol type.
301301 *
302- * This method is only for MRI developers interested in performance and memory
303- * usage of Ruby programs.
302+ * The types of Symbols are the following:
304303 *
305- * If the optional argument, result_hash, is given, it is overwritten and
306- * returned. This is intended to avoid probe effect.
304+ * - +mortal_dynamic_symbol+: Symbols that are garbage collectable.
305+ * - +immortal_dynamic_symbol+: Symbols that are objects allocated from the
306+ * garbage collector, but are not garbage collectable.
307+ * - +immortal_static_symbol+: Symbols that are not allocated from the
308+ * garbage collector, and are thus not garbage collectable.
309+ * - +immortal_symbol+: the sum of +immortal_dynamic_symbol+ and +immortal_static_symbol+.
307310 *
308- * Note:
309- * The contents of the returned hash is implementation defined.
310- * It may be changed in future.
311- *
312- * This method is only expected to work with C Ruby.
311+ * If the optional argument +result_hash+ is given, it is overwritten and
312+ * returned. This is intended to avoid the probe effect.
313313 *
314- * On this version of MRI, they have 3 types of Symbols (and 1 total counts).
314+ * This method is intended for developers interested in performance and memory
315+ * usage of Ruby programs. The contents of the returned hash is implementation
316+ * specific and may change in the future.
315317 *
316- * * mortal_dynamic_symbol: GC target symbols (collected by GC)
317- * * immortal_dynamic_symbol: Immortal symbols promoted from dynamic symbols (do not collected by GC)
318- * * immortal_static_symbol: Immortal symbols (do not collected by GC)
319- * * immortal_symbol: total immortal symbols (immortal_dynamic_symbol+immortal_static_symbol)
318+ * This method is only expected to work with C Ruby.
320319 */
321320
322321static VALUE
0 commit comments