ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- memsize_of-c.ri000064400000001371152370236310007461 0ustar00U:RDoc::AnyMethod[iI"memsize_of:ETI"ObjectSpace::memsize_of;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"2Return consuming memory size of obj in bytes.;To:RDoc::Markup::BlankLineo; ; [I"JNote that the return size is incomplete. You need to deal with this ;TI"Oinformation as only a *HINT*. Especially, the size of +T_DATA+ may not be ;TI" correct.;T@o; ; [I"6This method is only expected to work with C Ruby.;T@o; ; [I"CFrom Ruby 2.2, memsize_of(obj) returns a memory size includes ;TI"sizeof(RVALUE).;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I",ObjectSpace.memsize_of(obj) -> Integer ;T0[I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00cdesc-ObjectSpace.ri000064400000006337152370236310010354 0ustar00U:RDoc::NormalModule[iI"ObjectSpace:ET@0o:RDoc::Markup::Document: @parts[ o;;[: @fileI"!ext/objspace/lib/objspace.rb;T:0@omit_headings_from_table_of_contents_below0o;;[; I""ext/objspace/object_tracing.c;T; 0o;;[ o:RDoc::Markup::Paragraph;[I"JThe objspace library extends the ObjectSpace module and adds several ;TI"9methods to get internal statistic information about ;TI"object/memory management.;To:RDoc::Markup::BlankLineo; ;[I"NYou need to require 'objspace' to use this extension module.;T@o; ;[ I"EGenerally, you *SHOULD NOT* use this library if you do not know ;TI"Iabout the MRI implementation. Mainly, this library is for (memory) ;TI"Gprofiler developers and MRI developers who need to know about MRI ;TI"memory usage.;T; I"ext/objspace/objspace.c;T; 0o;;[; I"!ext/objspace/objspace_dump.c;T; 0o;;[ o; ;[I":The ObjectSpace module contains a number of routines ;TI"Ithat interact with the garbage collection facility and allow you to ;TI"2traverse all living objects with an iterator.;T@o; ;[ I"QObjectSpace also provides support for object finalizers, procs that will be ;TI"Gcalled when a specific object is about to be destroyed by garbage ;TI"+collection. See the documentation for ;TI"LObjectSpace.define_finalizer for important information on ;TI"&how to use this method correctly.;T@o:RDoc::Markup::Verbatim;[ I" a = "A" ;TI" b = "B" ;TI" ;TI"QObjectSpace.define_finalizer(a, proc {|id| puts "Finalizer one on #{id}" }) ;TI"QObjectSpace.define_finalizer(b, proc {|id| puts "Finalizer two on #{id}" }) ;TI" ;TI" a = nil ;TI" b = nil ;T: @format0o; ;[I"_produces:_;T@o; ;[I" Finalizer two on 537763470 ;TI"Finalizer one on 537763480;T;0; I" gc.c;T; 0o;;[; I" gc.rb;T; 0; 0; 0[[[[[I" class;T[[: public[[:protected[[: private["[I" _dump;TI"!ext/objspace/objspace_dump.c;T[I"_dump_all;T@W[I" _id2ref;TI" gc.c;T[I"allocation_class_path;TI""ext/objspace/object_tracing.c;T[I"allocation_generation;T@_[I"allocation_method_id;T@_[I"allocation_sourcefile;T@_[I"allocation_sourceline;T@_[I"count_imemo_objects;TI"ext/objspace/objspace.c;T[I"count_nodes;T@j[I"count_objects;T@\[I"count_objects_size;T@j[I"count_symbols;T@j[I"count_tdata_objects;T@j[I"define_finalizer;T@\[I"each_object;T@\[I"garbage_collect;TI" gc.rb;T[I"internal_class_of;T@j[I"internal_super_of;T@j[I"memsize_of;T@j[I"memsize_of_all;T@j[I"reachable_objects_from;T@j[I" reachable_objects_from_root;T@j[I"trace_object_allocations;T@_[I"#trace_object_allocations_clear;T@_[I")trace_object_allocations_debug_start;T@_[I"#trace_object_allocations_start;T@_[I""trace_object_allocations_stop;T@_[I"undefine_finalizer;T@\[I" instance;T[[;[[;[[;[[I" dump;TI"!ext/objspace/lib/objspace.rb;T[I" dump_all;T@š[@z@{[[U:RDoc::Context::Section[i0o;;[; 0; 0[I"!ext/objspace/lib/objspace.rb;TI""ext/objspace/object_tracing.c;TI"ext/objspace/objspace.c;TI"!ext/objspace/objspace_dump.c;TI" gc.c;TI" gc.rb;TI"lib/cgi/session.rb;TI"lib/drb/weakidconv.rb;TI"lib/weakref.rb;T@GcRDoc::TopLevelreachable_objects_from_root-c.ri000064400000001027152370236310013027 0ustar00U:RDoc::AnyMethod[iI" reachable_objects_from_root:ETI"-ObjectSpace::reachable_objects_from_root;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::List: @type: LABEL: @items[o:RDoc::Markup::ListItem: @label[I"MRI specific feature;T; [o:RDoc::Markup::Paragraph; [I",Return all reachable objects from root.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I"5ObjectSpace.reachable_objects_from_root -> hash ;T0[I"();T@FI"ObjectSpace;TcRDoc::NormalModule00allocation_sourceline-c.ri000064400000001041152370236310011673 0ustar00U:RDoc::AnyMethod[iI"allocation_sourceline:ETI"'ObjectSpace::allocation_sourceline;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"GReturns the original line from source for from the given +object+.;To:RDoc::Markup::BlankLineo; ; [I"FSee ::trace_object_allocations for more information and examples.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I".allocation_sourceline(object) -> integer ;T0[I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00internal_super_of-c.ri000064400000001277152370236310011047 0ustar00U:RDoc::AnyMethod[iI"internal_super_of:ETI"#ObjectSpace::internal_super_of;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::List: @type: LABEL: @items[o:RDoc::Markup::ListItem: @label[I"MRI specific feature;T; [o:RDoc::Markup::Paragraph; [I":Return internal super class of cls (Class or Module).;To;; [I"5obj can be an instance of InternalObjectWrapper.;To:RDoc::Markup::BlankLineo;; [I"BNote that you should not use this method in your application.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I";ObjectSpace.internal_super_of(cls) -> Class or Module ;T0[I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00count_tdata_objects-c.ri000064400000003056152370236310011344 0ustar00U:RDoc::AnyMethod[iI"count_tdata_objects:ETI"%ObjectSpace::count_tdata_objects;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"+Counts objects for each +T_DATA+ type.;To:RDoc::Markup::BlankLineo; ; [I"QThis method is only for MRI developers interested in performance and memory ;TI"usage of Ruby programs.;T@o; ; [I"It returns a hash as:;T@o:RDoc::Markup::Verbatim; [ I"A{RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6, ;TI"D :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99, ;TI"B ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1, ;TI"@ Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2} ;TI"5# T_DATA objects existing at startup on r32276. ;T: @format0o; ; [I"LIf the optional argument, result_hash, is given, it is overwritten and ;TI"6returned. This is intended to avoid probe effect.;T@o; ; [I"QThe contents of the returned hash is implementation specific and may change ;TI"in the future.;T@o; ; [I"=In this version, keys are Class object or Symbol object.;T@o; ; [I"OIf object is kind of normal (accessible) object, the key is Class object. ;TI"LIf object is not a kind of normal (internal) object, the key is symbol ;TI"-name, registered by rb_data_type_struct.;T@o; ; [I"6This method is only expected to work with C Ruby.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I" hash ;T0[I" (*args);T@0FI"ObjectSpace;TcRDoc::NormalModule00trace_object_allocations_stop-c.ri000064400000001126152370236310013403 0ustar00U:RDoc::AnyMethod[iI""trace_object_allocations_stop:ETI"/ObjectSpace::trace_object_allocations_stop;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"%Stop tracing object allocations.;To:RDoc::Markup::BlankLineo; ; [I"KNote that if ::trace_object_allocations_start is called n-times, then ;TI"Mtracing will stop after calling ::trace_object_allocations_stop n-times.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"#trace_object_allocations_stop ;T0[I"();T@FI"ObjectSpace;TcRDoc::NormalModule00allocation_generation-c.ri000064400000001547152370236310011671 0ustar00U:RDoc::AnyMethod[iI"allocation_generation:ETI"'ObjectSpace::allocation_generation;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"AReturns garbage collector generation for the given +object+.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I" class B ;TI" include ObjectSpace ;TI" ;TI" def foo ;TI"% trace_object_allocations do ;TI" obj = Object.new ;TI"; p "Generation is #{allocation_generation(obj)}" ;TI" end ;TI" end ;TI" end ;TI" ;TI"%B.new.foo #=> "Generation is 3" ;T: @format0o; ; [I"FSee ::trace_object_allocations for more information and examples.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"5allocation_generation(object) -> integer or nil ;T0[I" (p1);T@ FI"ObjectSpace;TcRDoc::NormalModule00trace_object_allocations-c.ri000064400000002206152370236310012336 0ustar00U:RDoc::AnyMethod[iI"trace_object_allocations:ETI"*ObjectSpace::trace_object_allocations;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"MStarts tracing object allocations from the ObjectSpace extension module.;To:RDoc::Markup::BlankLineo; ; [I"For example:;T@o:RDoc::Markup::Verbatim; [I"require 'objspace' ;TI" ;TI" class C ;TI" include ObjectSpace ;TI" ;TI" def foo ;TI"% trace_object_allocations do ;TI" obj = Object.new ;TI"K p "#{allocation_sourcefile(obj)}:#{allocation_sourceline(obj)}" ;TI" end ;TI" end ;TI" end ;TI" ;TI"#C.new.foo #=> "objtrace.rb:8" ;T: @format0o; ; [I"QThis example has included the ObjectSpace module to make it easier to read, ;TI"Pbut you can also use the ::trace_object_allocations notation (recommended).;T@o; ; [I"LNote that this feature introduces a huge performance decrease and huge ;TI"memory consumption.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"(trace_object_allocations { block } ;T0[I"();T@*FI"ObjectSpace;TcRDoc::NormalModule00internal_class_of-c.ri000064400000001247152370236310011013 0ustar00U:RDoc::AnyMethod[iI"internal_class_of:ETI"#ObjectSpace::internal_class_of;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::List: @type: LABEL: @items[o:RDoc::Markup::ListItem: @label[I"MRI specific feature;T; [o:RDoc::Markup::Paragraph; [I""Return internal class of obj.;To;; [I"5obj can be an instance of InternalObjectWrapper.;To:RDoc::Markup::BlankLineo;; [I"BNote that you should not use this method in your application.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I";ObjectSpace.internal_class_of(obj) -> Class or Module ;T0[I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00trace_object_allocations_clear-c.ri000064400000000635152370236310013510 0ustar00U:RDoc::AnyMethod[iI"#trace_object_allocations_clear:ETI"0ObjectSpace::trace_object_allocations_clear;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"(Clear recorded tracing information.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"$trace_object_allocations_clear ;T0[I"();T@FI"ObjectSpace;TcRDoc::NormalModule00garbage_collect-c.ri000064400000000465152370236310010424 0ustar00U:RDoc::AnyMethod[iI"garbage_collect:ETI"!ObjectSpace::garbage_collect;TT: privateo:RDoc::Markup::Document: @parts[: @fileI" gc.rb;T:0@omit_headings_from_table_of_contents_below000[I"C(full_mark: true, immediate_mark: true, immediate_sweep: true);T@ FI"ObjectSpace;TcRDoc::NormalModule00_id2ref-c.ri000064400000000352152370236310006634 0ustar00U:RDoc::AnyMethod[iI" _id2ref:ETI"ObjectSpace::_id2ref;TT: privateo:RDoc::Markup::Document: @parts[: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I" (p1);T@ FI"ObjectSpace;TcRDoc::NormalModule00garbage_collect-i.ri000064400000000464152370236310010431 0ustar00U:RDoc::AnyMethod[iI"garbage_collect:ETI" ObjectSpace#garbage_collect;TF: privateo:RDoc::Markup::Document: @parts[: @fileI" gc.rb;T:0@omit_headings_from_table_of_contents_below000[I"C(full_mark: true, immediate_mark: true, immediate_sweep: true);T@ FI"ObjectSpace;TcRDoc::NormalModule00reachable_objects_from-c.ri000064400000003764152370236310011776 0ustar00U:RDoc::AnyMethod[iI"reachable_objects_from:ETI"(ObjectSpace::reachable_objects_from;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::List: @type: LABEL: @items[o:RDoc::Markup::ListItem: @label[I"MRI specific feature;T; [o:RDoc::Markup::Paragraph; [I"-Return all reachable objects from `obj'.;To:RDoc::Markup::BlankLineo;; [I":This method returns all reachable objects from `obj'.;T@o;; [I"OIf `obj' has two or more references to the same object `x', then returned ;TI"(array only includes one `x' object.;T@o;; [I"KIf `obj' is a non-markable (non-heap management) object such as true, ;TI"Mfalse, nil, symbols and Fixnums (and Flonum) then it simply returns nil.;T@o;; [ I"QIf `obj' has references to an internal object, then it returns instances of ;TI"PObjectSpace::InternalObjectWrapper class. This object contains a reference ;TI"Nto an internal object and you can check the type of internal object with ;TI"`type' method.;T@o;; [I"QIf `obj' is instance of ObjectSpace::InternalObjectWrapper class, then this ;TI"Kmethod returns all reachable object from an internal object, which is ;TI"pointed by `obj'.;T@o;; [I"1With this method, you can find memory leaks.;T@o;; [I"=This method is only expected to work except with C Ruby.;T@o;; [I" Example:;To:RDoc::Markup::Verbatim; [I"9ObjectSpace.reachable_objects_from(['a', 'b', 'c']) ;TI" #=> [Array, 'a', 'b', 'c'] ;TI" ;TI"9ObjectSpace.reachable_objects_from(['a', 'a', 'a']) ;TI"K#=> [Array, 'a', 'a', 'a'] # all 'a' strings have different object id ;TI" ;TI"9ObjectSpace.reachable_objects_from([v = 'a', v, v]) ;TI"#=> [Array, 'a'] ;TI" ;TI"+ObjectSpace.reachable_objects_from(1) ;TI"6#=> nil # 1 is not markable (heap managed) object;T: @format0: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I"=ObjectSpace.reachable_objects_from(obj) -> array or nil ;T0[I" (p1);T@AFI"ObjectSpace;TcRDoc::NormalModule00count_objects_size-c.ri000064400000002133152370236310011214 0ustar00U:RDoc::AnyMethod[iI"count_objects_size:ETI"$ObjectSpace::count_objects_size;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"2Counts objects size (in bytes) for each type.;To:RDoc::Markup::BlankLineo; ; [I"FNote that this information is incomplete. You need to deal with ;TI"Cthis information as only a *HINT*. Especially, total size of ;TI"T_DATA may be wrong.;T@o; ; [I"It returns a hash as:;To:RDoc::Markup::Verbatim; [I"S{:TOTAL=>1461154, :T_CLASS=>158280, :T_MODULE=>20672, :T_STRING=>527249, ...} ;T: @format0o; ; [I"6If the optional argument, result_hash, is given, ;TI"%it is overwritten and returned. ;TI",This is intended to avoid probe effect.;T@o; ; [I"BThe contents of the returned hash is implementation defined. ;TI"!It may be changed in future.;T@o; ; [I"6This method is only expected to work with C Ruby.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I";ObjectSpace.count_objects_size([result_hash]) -> hash ;T0[I" (*args);T@&FI"ObjectSpace;TcRDoc::NormalModule00undefine_finalizer-c.ri000064400000000566152370236310011171 0ustar00U:RDoc::AnyMethod[iI"undefine_finalizer:ETI"$ObjectSpace::undefine_finalizer;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"+Removes all finalizers for obj.;T: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below0I")ObjectSpace.undefine_finalizer(obj) ;T0[I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00define_finalizer-c.ri000064400000004761152370236310010627 0ustar00U:RDoc::AnyMethod[iI"define_finalizer:ETI""ObjectSpace::define_finalizer;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [ I"EAdds aProc as a finalizer, to be called after obj ;TI"Cwas destroyed. The object ID of the obj will be passed ;TI"Das an argument to aProc. If aProc is a lambda or ;TI"?method, make sure it can be called with a single argument.;To:RDoc::Markup::BlankLineo; ; [I":The return value is an array [0, aProc].;T@o; ; [ I"JThe two recommended patterns are to either create the finaliser proc ;TI"Lin a non-instance method where it can safely capture the needed state, ;TI"Eor to use a custom callable object that stores the needed state ;TI"&explicitly as instance variables.;T@o:RDoc::Markup::Verbatim; [ I"class Foo ;TI"4 def initialize(data_needed_for_finalization) ;TI"g ObjectSpace.define_finalizer(self, self.class.create_finalizer(data_needed_for_finalization)) ;TI" end ;TI" ;TI"? def self.create_finalizer(data_needed_for_finalization) ;TI" proc { ;TI"= puts "finalizing #{data_needed_for_finalization}" ;TI" } ;TI" end ;TI" end ;TI" ;TI"class Bar ;TI" class Remover ;TI"6 def initialize(data_needed_for_finalization) ;TI"H @data_needed_for_finalization = data_needed_for_finalization ;TI" end ;TI" ;TI" def call(id) ;TI"> puts "finalizing #{@data_needed_for_finalization}" ;TI" end ;TI" end ;TI" ;TI"4 def initialize(data_needed_for_finalization) ;TI"W ObjectSpace.define_finalizer(self, Remover.new(data_needed_for_finalization)) ;TI" end ;TI" end ;T: @format0o; ; [ I"=Note that if your finalizer references the object to be ;TI"Efinalized it will never be run on GC, although it will still be ;TI"Crun at exit. You will get a warning if you capture the object ;TI"6to be finalized as the receiver of the finalizer.;T@o; ; [ I"class CapturesSelf ;TI" def initialize(name) ;TI"3 ObjectSpace.define_finalizer(self, proc { ;TI"5 # this finalizer will only be run on exit ;TI"% puts "finalizing #{name}" ;TI" }) ;TI" end ;TI" end ;T; 0o; ; [I"NAlso note that finalization can be unpredictable and is never guaranteed ;TI"to be run except on exit.;T: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below0I"5ObjectSpace.define_finalizer(obj, aProc=proc()) ;T0[I"(p1, p2 = v2);T@LFI"ObjectSpace;TcRDoc::NormalModule00dump_all-i.ri000064400000003036152370236310007127 0ustar00U:RDoc::AnyMethod[iI" dump_all:ETI"ObjectSpace#dump_all;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"0Dump the contents of the ruby heap as JSON.;To:RDoc::Markup::BlankLineo; ; [I"5_since_ must be a non-negative integer or +nil+.;T@o; ; [I"KIf _since_ is a positive integer, only objects of that generation and ;TI"Pnewer generations are dumped. The current generation can be accessed using ;TI"GC::count.;T@o; ; [I"KObjects that were allocated without object allocation tracing enabled ;TI"Jare ignored. See ::trace_object_allocations for more information and ;TI"examples.;T@o; ; [I"?If _since_ is omitted or is +nil+, all objects are dumped.;T@o; ; [ I"7This method is only expected to work with C Ruby. ;TI">This is an experimental method and is subject to change. ;TI"AIn particular, the function signature and output format are ;TI"@not guaranteed to be compatible in future versions of ruby.;T: @fileI"!ext/objspace/lib/objspace.rb;T:0@omit_headings_from_table_of_contents_below0I"„ObjectSpace.dump_all([output: :file]) # => # ObjectSpace.dump_all(output: :stdout) # => nil ObjectSpace.dump_all(output: :string) # => "{...}\n{...}\n..." ObjectSpace.dump_all(output: File.open('heap.json','w')) # => # ObjectSpace.dump_all(output: :string, since: 42) # => "{...}\n{...}\n..." ;T0[I"-(output: :file, full: false, since: nil);T@%FI"ObjectSpace;TcRDoc::NormalModule00allocation_class_path-c.ri000064400000001451152370236310011651 0ustar00U:RDoc::AnyMethod[iI"allocation_class_path:ETI"'ObjectSpace::allocation_class_path;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I".Returns the class for the given +object+.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I" class A ;TI" def foo ;TI"2 ObjectSpace::trace_object_allocations do ;TI" obj = Object.new ;TI": p "#{ObjectSpace::allocation_class_path(obj)}" ;TI" end ;TI" end ;TI" end ;TI" ;TI"A.new.foo #=> "Class" ;T: @format0o; ; [I"FSee ::trace_object_allocations for more information and examples.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"-allocation_class_path(object) -> string ;T0[I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00dump-i.ri000064400000001516152370236310006300 0ustar00U:RDoc::AnyMethod[iI" dump:ETI"ObjectSpace#dump;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"0Dump the contents of a ruby object as JSON.;To:RDoc::Markup::BlankLineo; ; [ I"7This method is only expected to work with C Ruby. ;TI">This is an experimental method and is subject to change. ;TI"AIn particular, the function signature and output format are ;TI"@not guaranteed to be compatible in future versions of ruby.;T: @fileI"!ext/objspace/lib/objspace.rb;T:0@omit_headings_from_table_of_contents_below0I"ÈObjectSpace.dump(obj[, output: :string]) # => "{ ... }" ObjectSpace.dump(obj, output: :file) # => # ObjectSpace.dump(obj, output: :stdout) # => nil ;T0[I"(obj, output: :string);T@FI"ObjectSpace;TcRDoc::NormalModule00count_objects-c.ri000064400000002433152370236310010165 0ustar00U:RDoc::AnyMethod[iI"count_objects:ETI"ObjectSpace::count_objects;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"(Counts all objects grouped by type.;To:RDoc::Markup::BlankLineo; ; [I" It returns a hash, such as:;To:RDoc::Markup::Verbatim; [ I"{ ;TI" :TOTAL=>10000, ;TI" :FREE=>3011, ;TI" :T_OBJECT=>6, ;TI" :T_CLASS=>404, ;TI" # ... ;TI"} ;T: @format0o; ; [I"DThe contents of the returned hash are implementation specific. ;TI"!It may be changed in future.;T@o; ; [ I"6The keys starting with +:T_+ means live objects. ;TI"6For example, +:T_ARRAY+ is the number of arrays. ;TI"7+:FREE+ means object slots which is not used now. ;TI"!+:TOTAL+ means sum of above.;T@o; ; [I"6If the optional argument +result_hash+ is given, ;TI"Lit is overwritten and returned. This is intended to avoid probe effect.;T@o; ; [ I" h = {} ;TI""ObjectSpace.count_objects(h) ;TI" puts h ;TI"S# => { :TOTAL=>10000, :T_CLASS=>158280, :T_MODULE=>20672, :T_STRING=>527249 } ;T; 0o; ; [I"4This method is only expected to work on C Ruby.;T: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below0I"6ObjectSpace.count_objects([result_hash]) -> hash ;T0[I" (*args);T@2FI"ObjectSpace;TcRDoc::NormalModule00WeakMap/length-i.ri000064400000000572152370236310010142 0ustar00U:RDoc::AnyMethod[iI" length:ETI" ObjectSpace::WeakMap#length;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"-Returns the number of referenced objects;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" WeakMap;TcRDoc::NormalClass0[I"ObjectSpace::WeakMap;TFI" size;TWeakMap/each_pair-i.ri000064400000000624152370236310010572 0ustar00U:RDoc::AnyMethod[iI"each_pair:ETI"#ObjectSpace::WeakMap#each_pair;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AIterates over keys and objects in a weakly referenced object;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" WeakMap;TcRDoc::NormalClass0[I"ObjectSpace::WeakMap;TFI" each;TWeakMap/each_value-i.ri000064400000000556152370236310010757 0ustar00U:RDoc::AnyMethod[iI"each_value:ETI"$ObjectSpace::WeakMap#each_value;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AIterates over keys and objects in a weakly referenced object;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" WeakMap;TcRDoc::NormalClass00WeakMap/inspect-i.ri000064400000000353152370236310010323 0ustar00U:RDoc::AnyMethod[iI" inspect:ETI"!ObjectSpace::WeakMap#inspect;TF: privateo:RDoc::Markup::Document: @parts[: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" WeakMap;TcRDoc::NormalClass00WeakMap/key%3f-i.ri000064400000000571152370236310007746 0ustar00U:RDoc::AnyMethod[iI" key?:ETI"ObjectSpace::WeakMap#key?;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"*Returns +true+ if +key+ is registered;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I" (p1);T@FI" WeakMap;TcRDoc::NormalClass0[I"ObjectSpace::WeakMap;TFI" include?;TWeakMap/values-i.ri000064400000000550152370236310010154 0ustar00U:RDoc::AnyMethod[iI" values:ETI" ObjectSpace::WeakMap#values;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"CIterates over values and objects in a weakly referenced object;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" WeakMap;TcRDoc::NormalClass00WeakMap/include%3f-i.ri000064400000000566152370236310010605 0ustar00U:RDoc::AnyMethod[iI" include?:ETI""ObjectSpace::WeakMap#include?;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"*Returns +true+ if +key+ is registered;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[[I" member?;T@ [I" key?;T@ I" (p1);T@FI" WeakMap;TcRDoc::NormalClass00WeakMap/size-i.ri000064400000000537152370236310007634 0ustar00U:RDoc::AnyMethod[iI" size:ETI"ObjectSpace::WeakMap#size;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"-Returns the number of referenced objects;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[[I" length;T@ I"();T@FI" WeakMap;TcRDoc::NormalClass00WeakMap/%5b%5d-i.ri000064400000000533152370236310007527 0ustar00U:RDoc::AnyMethod[iI"[]:ETI"ObjectSpace::WeakMap#[];TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"any objects, but those objects can get garbage collected.;To:RDoc::Markup::BlankLineo; ;[I"AThis class is mostly used internally by WeakRef, please use ;TI"/+lib/weakref.rb+ for the public interface.;T: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[[[I"Enumerable;To;;[; @; 0I" gc.c;T[[I" class;T[[: public[[:protected[[: private[[I" instance;T[[; [[;[[;[[I"[];T@[I"[]=;T@[I" each;T@[I" each_key;T@[I"each_pair;T@[I"each_value;T@[I" include?;T@[I" inspect;T@[I" key?;T@[I" keys;T@[I" length;T@[I" member?;T@[I" size;T@[I" values;T@[[U:RDoc::Context::Section[i0o;;[; 0; 0[I"ext/objspace/objspace.c;TI"ObjectSpace;TcRDoc::NormalModuleWeakMap/%5b%5d%3d-i.ri000064400000000550152370236310010022 0ustar00U:RDoc::AnyMethod[iI"[]=:ETI"ObjectSpace::WeakMap#[]=;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"CCreates a weak reference from the given key to the given value;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I" (p1, p2);T@FI" WeakMap;TcRDoc::NormalClass00WeakMap/keys-i.ri000064400000000542152370236310007631 0ustar00U:RDoc::AnyMethod[iI" keys:ETI"ObjectSpace::WeakMap#keys;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AIterates over keys and objects in a weakly referenced object;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" WeakMap;TcRDoc::NormalClass00WeakMap/member%3f-i.ri000064400000000577152370236310010433 0ustar00U:RDoc::AnyMethod[iI" member?:ETI"!ObjectSpace::WeakMap#member?;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"*Returns +true+ if +key+ is registered;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I" (p1);T@FI" WeakMap;TcRDoc::NormalClass0[I"ObjectSpace::WeakMap;TFI" include?;TWeakMap/each-i.ri000064400000000566152370236310007564 0ustar00U:RDoc::AnyMethod[iI" each:ETI"ObjectSpace::WeakMap#each;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AIterates over keys and objects in a weakly referenced object;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[[I"each_pair;T@ I"();T@FI" WeakMap;TcRDoc::NormalClass00WeakMap/each_key-i.ri000064400000000552152370236310010427 0ustar00U:RDoc::AnyMethod[iI" each_key:ETI""ObjectSpace::WeakMap#each_key;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AIterates over keys and objects in a weakly referenced object;To:RDoc::Markup::BlankLine: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" WeakMap;TcRDoc::NormalClass00allocation_sourcefile-c.ri000064400000001025152370236310011665 0ustar00U:RDoc::AnyMethod[iI"allocation_sourcefile:ETI"'ObjectSpace::allocation_sourcefile;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" string ;T0[I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00_dump-c.ri000064400000000402152370236310006422 0ustar00U:RDoc::AnyMethod[iI" _dump:ETI"ObjectSpace::_dump;TT: privateo:RDoc::Markup::Document: @parts[: @fileI"!ext/objspace/objspace_dump.c;T:0@omit_headings_from_table_of_contents_below000[I" (p1, p2);T@ FI"ObjectSpace;TcRDoc::NormalModule00trace_object_allocations_debug_start-c.ri000064400000000473152370236310014725 0ustar00U:RDoc::AnyMethod[iI")trace_object_allocations_debug_start:ETI"6ObjectSpace::trace_object_allocations_debug_start;TT: privateo:RDoc::Markup::Document: @parts[: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"ObjectSpace;TcRDoc::NormalModule00allocation_method_id-c.ri000064400000001536152370236310011470 0ustar00U:RDoc::AnyMethod[iI"allocation_method_id:ETI"&ObjectSpace::allocation_method_id;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I":Returns the method identifier for the given +object+.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I" class A ;TI" include ObjectSpace ;TI" ;TI" def foo ;TI"% trace_object_allocations do ;TI" obj = Object.new ;TI"J p "#{allocation_class_path(obj)}##{allocation_method_id(obj)}" ;TI" end ;TI" end ;TI" end ;TI" ;TI"A.new.foo #=> "Class#new" ;T: @format0o; ; [I"FSee ::trace_object_allocations for more information and examples.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I",allocation_method_id(object) -> string ;T0[I" (p1);T@ FI"ObjectSpace;TcRDoc::NormalModule00count_nodes-c.ri000064400000001774152370236310007653 0ustar00U:RDoc::AnyMethod[iI"count_nodes:ETI"ObjectSpace::count_nodes;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"%Counts nodes for each node type.;To:RDoc::Markup::BlankLineo; ; [I"QThis method is only for MRI developers interested in performance and memory ;TI"usage of Ruby programs.;T@o; ; [I"It returns a hash as:;T@o:RDoc::Markup::Verbatim; [I"E{:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...} ;T: @format0o; ; [I"LIf the optional argument, result_hash, is given, it is overwritten and ;TI"6returned. This is intended to avoid probe effect.;T@o; ; [I" Note: ;TI"BThe contents of the returned hash is implementation defined. ;TI"!It may be changed in future.;T@o; ; [I"6This method is only expected to work with C Ruby.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I"4ObjectSpace.count_nodes([result_hash]) -> hash ;T0[I" (*args);T@%FI"ObjectSpace;TcRDoc::NormalModule00memsize_of_all-c.ri000064400000002332152370236310010307 0ustar00U:RDoc::AnyMethod[iI"memsize_of_all:ETI" ObjectSpace::memsize_of_all;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AReturn consuming memory size of all living objects in bytes.;To:RDoc::Markup::BlankLineo; ; [I"PIf +klass+ (should be Class object) is given, return the total memory size ;TI"%of instances of the given class.;T@o; ; [I"KNote that the returned size is incomplete. You need to deal with this ;TI"Oinformation as only a *HINT*. Especially, the size of +T_DATA+ may not be ;TI" correct.;T@o; ; [I"INote that this method does *NOT* return total malloc'ed memory size.;T@o; ; [I";This method can be defined by the following Ruby code:;T@o:RDoc::Markup::Verbatim; [ I"&def memsize_of_all klass = false ;TI" total = 0 ;TI"# ObjectSpace.each_object{|e| ;TI"S total += ObjectSpace.memsize_of(e) if klass == false || e.kind_of?(klass) ;TI" } ;TI" total ;TI" end ;T: @format0o; ; [I"6This method is only expected to work with C Ruby.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I"4ObjectSpace.memsize_of_all([klass]) -> Integer ;T0[I"(p1 = v1);T@*FI"ObjectSpace;TcRDoc::NormalModule00_dump_all-c.ri000064400000000416152370236310007257 0ustar00U:RDoc::AnyMethod[iI"_dump_all:ETI"ObjectSpace::_dump_all;TT: privateo:RDoc::Markup::Document: @parts[: @fileI"!ext/objspace/objspace_dump.c;T:0@omit_headings_from_table_of_contents_below000[I"(p1, p2, p3);T@ FI"ObjectSpace;TcRDoc::NormalModule00InternalObjectWrapper/inspect-i.ri000064400000000556152370236310013247 0ustar00U:RDoc::AnyMethod[iI" inspect:ETI"/ObjectSpace::InternalObjectWrapper#inspect;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"See Object#inspect.;To:RDoc::Markup::BlankLine: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"InternalObjectWrapper;TcRDoc::NormalClass00InternalObjectWrapper/type-i.ri000064400000000575152370236310012564 0ustar00U:RDoc::AnyMethod[iI" type:ETI",ObjectSpace::InternalObjectWrapper#type;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"-Returns the type of the internal object.;To:RDoc::Markup::BlankLine: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"InternalObjectWrapper;TcRDoc::NormalClass00InternalObjectWrapper/cdesc-InternalObjectWrapper.ri000064400000001662152370236310016676 0ustar00U:RDoc::NormalClass[iI"InternalObjectWrapper:ETI"'ObjectSpace::InternalObjectWrapper;TI" Object;To:RDoc::Markup::Document: @parts[o;;[ o:RDoc::Markup::Paragraph;[I"/This class is used as a return value from ;TI")ObjectSpace::reachable_objects_from.;To:RDoc::Markup::BlankLineo; ;[I"EWhen ObjectSpace::reachable_objects_from returns an object with ;TI"Mreferences to an internal object, an instance of this class is returned.;T@o; ;[I"KYou can use the #type method to check the type of the internal object.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[[[[I" class;T[[: public[[:protected[[: private[[I" instance;T[[; [[;[[;[[I" inspect;TI"ext/objspace/objspace.c;T[I"internal_object_id;T@3[I" type;T@3[[U:RDoc::Context::Section[i0o;;[; 0; 0[I"ext/objspace/objspace.c;TI"ObjectSpace;TcRDoc::NormalModuleInternalObjectWrapper/internal_object_id-i.ri000064400000000645152370236310015417 0ustar00U:RDoc::AnyMethod[iI"internal_object_id:ETI":ObjectSpace::InternalObjectWrapper#internal_object_id;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"9Returns the Object#object_id of the internal object.;To:RDoc::Markup::BlankLine: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"InternalObjectWrapper;TcRDoc::NormalClass00each_object-c.ri000064400000003002152370236310007543 0ustar00U:RDoc::AnyMethod[iI"each_object:ETI"ObjectSpace::each_object;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"GCalls the block once for each living, nonimmediate object in this ;TI"BRuby process. If module is specified, calls the block ;TI"Ifor only those classes or modules that match (or are a subclass of) ;TI"Cmodule. Returns the number of objects found. Immediate ;TI"9objects (Fixnums, Symbols ;TI"Ftrue, false, and nil) are ;TI"Enever returned. In the example below, #each_object returns both ;TI"Fthe numbers we defined and several constants defined in the Math ;TI" module.;To:RDoc::Markup::BlankLineo; ; [I"=If no block is given, an enumerator is returned instead.;T@o:RDoc::Markup::Verbatim; [ I"a = 102.7 ;TI"&b = 95 # Won't be returned ;TI"c = 12345678987654321 ;TI"9count = ObjectSpace.each_object(Numeric) {|x| p x } ;TI""puts "Total count: #{count}" ;T: @format0o; ; [I"produces:;T@o; ; [ I"12345678987654321 ;TI" 102.7 ;TI"2.71828182845905 ;TI"3.14159265358979 ;TI"2.22044604925031e-16 ;TI"1.7976931348623157e+308 ;TI"2.2250738585072e-308 ;TI"Total count: 7;T; 0: @fileI" gc.c;T:0@omit_headings_from_table_of_contents_below0I"ObjectSpace.each_object([module]) {|obj| ... } -> integer ObjectSpace.each_object([module]) -> an_enumerator ;T0[I" (*args);T@.FI"ObjectSpace;TcRDoc::NormalModule00trace_object_allocations_start-c.ri000064400000000634152370236310013556 0ustar00U:RDoc::AnyMethod[iI"#trace_object_allocations_start:ETI"0ObjectSpace::trace_object_allocations_start;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"'Starts tracing object allocations.;T: @fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"$trace_object_allocations_start ;T0[I"();T@FI"ObjectSpace;TcRDoc::NormalModule00count_imemo_objects-c.ri000064400000002203152370236310011346 0ustar00U:RDoc::AnyMethod[iI"count_imemo_objects:ETI"%ObjectSpace::count_imemo_objects;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I",Counts objects for each +T_IMEMO+ type.;To:RDoc::Markup::BlankLineo; ; [I"QThis method is only for MRI developers interested in performance and memory ;TI"usage of Ruby programs.;T@o; ; [I"It returns a hash as:;T@o:RDoc::Markup::Verbatim; [ I"{:imemo_ifunc=>8, ;TI" :imemo_svar=>7, ;TI" :imemo_cref=>509, ;TI" :imemo_memo=>1, ;TI" :imemo_throw_data=>1} ;T: @format0o; ; [I"LIf the optional argument, result_hash, is given, it is overwritten and ;TI"6returned. This is intended to avoid probe effect.;T@o; ; [I"QThe contents of the returned hash is implementation specific and may change ;TI"in the future.;T@o; ; [I".In this version, keys are symbol objects.;T@o; ; [I"6This method is only expected to work with C Ruby.;T: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I" hash ;T0[I" (*args);T@+FI"ObjectSpace;TcRDoc::NormalModule00count_symbols-c.ri000064400000002520152370236310010221 0ustar00U:RDoc::AnyMethod[iI"count_symbols:ETI"ObjectSpace::count_symbols;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I")Counts symbols for each Symbol type.;To:RDoc::Markup::BlankLineo; ; [I"QThis method is only for MRI developers interested in performance and memory ;TI"usage of Ruby programs.;T@o; ; [I"LIf the optional argument, result_hash, is given, it is overwritten and ;TI"6returned. This is intended to avoid probe effect.;T@o; ; [I" Note: ;TI"BThe contents of the returned hash is implementation defined. ;TI"!It may be changed in future.;T@o; ; [I"6This method is only expected to work with C Ruby.;T@o; ; [I"OOn this version of MRI, they have 3 types of Symbols (and 1 total counts).;T@o:RDoc::Markup::Verbatim; [ I"B* mortal_dynamic_symbol: GC target symbols (collected by GC) ;TI"h* immortal_dynamic_symbol: Immortal symbols promoted from dynamic symbols (do not collected by GC) ;TI"I* immortal_static_symbol: Immortal symbols (do not collected by GC) ;TI"_* immortal_symbol: total immortal symbols (immortal_dynamic_symbol+immortal_static_symbol);T: @format0: @fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I"6ObjectSpace.count_symbols([result_hash]) -> hash ;T0[I" (*args);T@(FI"ObjectSpace;TcRDoc::NormalModule00