2件ヒット
[1-2件を表示]
(0.040秒)
ライブラリ
- objspace (2)
キーワード
検索結果
先頭2件
-
ObjectSpace
. # allocation _ sourcefile(object) -> String (9310.0) -
objectの元となったソースファイル名を返します。
...uby]{
require 'objspace'
ObjectSpace::trace_object_allocations_start
obj = Object.new
puts "file:#{ObjectSpace::allocation_sourcefile(obj)}" # => file:test.rb
ObjectSpace::trace_object_allocations_stop
//}
@see ObjectSpace.#trace_object_allocations_start,
ObjectSpace.#trace_object_allocatio... -
ObjectSpace
. # count _ objects _ size(result _ hash = nil) -> Hash (9025.0) -
型ごとのオブジェクトサイズをバイト単位で格納したハッシュを返します。
...くまでもヒ
ントとして扱う必要があります。特に T_DATA の合計値は正しくないでしょう。
//emlist[例][ruby]{
ObjectSpace.count_objects_size
# => {:TOTAL=>1461154, :T_CLASS=>158280, :T_MODULE=>20672, :T_STRING=>527249, ...}
//}
@raise TypeError result_hash にハッ...