1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

4 commits

Author SHA1 Message Date
Yusuke Endoh
f691c15792 ext/objspace/lib/objspace/trace.rb: Remove the original Kernel#p
... to disable a "method redefined" warning.

http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210514T050008Z.fail.html.gz
```
  1) Failure:
TestObjSpace#test_objspace_trace [/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/test/objspace/test_objspace.rb:621]:
<["objspace/trace is enabled"]> expected but was
<["/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/.ext/common/objspace/trace.rb:29: warning: method redefined; discarding old p",
 "objspace/trace is enabled"]>.
```
2021-05-14 15:39:57 +09:00
Yusuke Endoh
cf1e1879f1 ext/objspace/lib/objspace/trace.rb: Added
This file, when require'ed, starts tracing the object allocations, and
redefines `Kernel#p` to show the allocation site.

This commit is experimental; the library name and APIs may change.

[Feature #17762]
2021-05-14 13:40:32 +09:00
Kazuhiro NISHIYAMA
d0a7189f26 Fix ObjectSpace.dump(obj, output: :stdout)
RDoc says `ObjectSpace.dump(obj, output: :stdout)   # => nil`,
but it returns STDOUT since fbba6bd4e3.

I think it is unintentional change.
2020-10-03 00:00:01 +09:00
Jean Boussier
fbba6bd4e3 Parse ObjectSpace.dump_all / dump arguments in Ruby to avoid allocation noise
[Feature #17045] ObjectSpace.dump_all should allocate as little as possible in the GC heap

Up until this commit ObjectSpace.dump_all allocates two Hash because of `rb_scan_args`.

It also can allocate a `File` because of `rb_io_get_write_io`.

These allocations are problematic because `dump_all` dumps the Ruby
heap, so it should try modify as little as possible what it is
observing.
2020-09-15 09:18:13 -07:00