mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Move more of GC.latest_gc_info into Ruby
This commit is contained in:
parent
461c48960d
commit
f8e1c93fe1
Notes:
git
2024-09-18 16:58:23 +00:00
2 changed files with 9 additions and 14 deletions
10
gc.rb
10
gc.rb
|
@ -320,7 +320,15 @@ module GC
|
|||
# it is overwritten and returned.
|
||||
# This is intended to avoid probe effect.
|
||||
def self.latest_gc_info hash_or_key = nil
|
||||
Primitive.gc_latest_gc_info hash_or_key
|
||||
if hash_or_key == nil
|
||||
hash_or_key = {}
|
||||
elsif Primitive.cexpr!("RBOOL(!SYMBOL_P(hash_or_key) && !RB_TYPE_P(hash_or_key, T_HASH))")
|
||||
raise TypeError, "non-hash or symbol given"
|
||||
end
|
||||
|
||||
Primitive.cstmt! %{
|
||||
return rb_gc_latest_gc_info(hash_or_key);
|
||||
}
|
||||
end
|
||||
|
||||
# call-seq:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue