るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

検索結果

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

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

...t.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 ObjectSpa...

ObjectSpace.#trace_object_allocations { ... } (8013.0)

与えられたブロック内でオブジェクトのトレースを行います。 

...ジェクトのトレースを行います。 

//emlist[例][ruby]{
require 'objspace'

class C
include ObjectSpace

def foo
trace_object_allocations do
obj = Object.new
p "#{allocation_sourcefile(obj)}:#{allocation_sourceline(obj)}"
end
end
end

C.new.foo #=> "objtrace....