22件ヒット
[1-22件を表示]
(0.149秒)
ライブラリ
- objspace (22)
モジュール
- ObjectSpace (22)
検索結果
先頭2件
-
ObjectSpace
. # allocation _ sourcefile(object) -> String (36407.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 { . . . } (18306.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.rb:...