るりまサーチ

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

別のキーワード

  1. shell cat
  2. commandprocessor cat
  3. cat new
  4. cat each
  5. shell/filter cat

ライブラリ

モジュール

検索結果

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

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
ObjectSp...
...ace::trace_object_allocations_stop
//}

@see ObjectSpace.#trace_object_allocations_start,
ObjectSpace.#trace_object_allocations_stop...

ObjectSpace.#trace_object_allocations { ... } (12206.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....