class method
ObjectSpace.count_nodes
ObjectSpace.count_nodes([result_hash]) → hash
ext/objspace/objspace.c
View on GitHub ↗
static VALUE
count_nodes(int argc, VALUE *argv, VALUE os)
{
return setup_hash(argc, argv);
}
Counts nodes for each node type.
This method is only for MRI developers interested in performance and memory usage of Ruby programs.
It returns a hash as:
{:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...}
If the optional argument, result_hash, is given, it is overwritten and returned. This is intended to avoid probe effect.
Note: The contents of the returned hash is implementation defined. It may be changed in future.
This method is only expected to work with C Ruby.
See also
.count_imemo_objects
.count_objects
.allocation_sourceline
.count_objects_size
also in
3.4 · 3.3 · 3.2 · 3.1 · 3.0