るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.049秒)
トップページ > クエリ:String[x] > モジュール:ObjectSpace[x]

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

ライブラリ

キーワード

検索結果

ObjectSpace.#allocation_sourcefile(object) -> String (102.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 (7.0)

型ごとのオブジェクトサイズをバイト単位で格納したハッシュを返します。

...があります。特に T_DATA の合計値は正しくないでしょう。

//emlist[例][ruby]{
ObjectSpace
.count_objects_size
# => {:TOTAL=>1461154, :T_CLASS=>158280, :T_MODULE=>20672, :T_STRING=>527249, ...}
//}

@raise TypeError result_hash にハッシュ以外を指定した時に発生し...