mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add GC.stat_size_pool to get stats for a size pool
GC.stat_size_pool will return stats for a particular size pool. This is used for the Variable Width Allocation feature.
This commit is contained in:
parent
09ef048b34
commit
6157619bb6
Notes:
git
2021-11-26 00:33:37 +09:00
3 changed files with 161 additions and 0 deletions
18
gc.rb
18
gc.rb
|
@ -196,6 +196,24 @@ module GC
|
|||
Primitive.gc_stat hash_or_key
|
||||
end
|
||||
|
||||
# :nodoc:
|
||||
# call-seq:
|
||||
# GC.stat_size_pool(size_pool_idx) -> Hash
|
||||
# GC.stat_size_pool(size_pool_idx, hash) -> Hash
|
||||
# GC.stat_size_pool(size_pool_idx, :key) -> Numeric
|
||||
#
|
||||
# Returns a Hash containing information about a size pool in the GC.
|
||||
#
|
||||
# The contents of the hash are implementation specific and may be changed in
|
||||
# the future.
|
||||
#
|
||||
# If the optional argument, hash, is given, it is overwritten and returned.
|
||||
#
|
||||
# This method is only expected to work on C Ruby.
|
||||
def self.stat_size_pool size_pool_idx, hash_or_key = nil
|
||||
Primitive.gc_stat_size_pool size_pool_idx, hash_or_key
|
||||
end
|
||||
|
||||
# call-seq:
|
||||
# GC.latest_gc_info -> {:gc_by=>:newobj}
|
||||
# GC.latest_gc_info(hash) -> hash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue