るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.039秒)
トップページ > クエリ:u[x] > クエリ:allocation_sourcefile[x] > 種類:モジュール関数[x]

別のキーワード

  1. objspace allocation_sourcefile
  2. objspace allocation_sourceline
  3. objectspace allocation_sourcefile
  4. objectspace allocation_sourceline
  5. allocation_sourcefile objspace

ライブラリ

モジュール

検索結果

ObjectSpace.#allocation_sourcefile(object) -> String (24208.0)

objectの元となったソースファイル名を返します。

...return objectの元となるソースファイル名を返します。存在しない場合はnilを返します。

//emlist[例:test.rbというファイルで下記のスクリプトを実行した場合][ruby]{
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_allocations_stop...