ruby/ext/objspace
Jean Boussier 73771e4b19 ObjectSpace.dump_all: dump shapes as well
I see several arguments in doing so.

First they use a non trivial amount of memory, so for various memory
profiling/mapping tools it is relevant to have visibility of the space
occupied by shapes.

Then, some pathological code can create a tons of shape, so it is
valuable to have a way to have a way to observe shapes without having
to compile Ruby with `SHAPE_DEBUG=1`.

And additionally it's likely much faster to dump then this way than
to use `RubyVM::Shape`.

There are however a few open questions:

- Shapes can't respect the `since:` argument. Not sure what to do when
  it is provided. Would probably make sense to not dump them.
- Maybe it would make more sense to have a separate `ObjectSpace.dump_shapes`?
- Maybe instead `dump_all` should take a `shapes: false` argument?

Additionally, `ObjectSpace.dump_shapes` is added for the use case of
debugging the evolution of the shape tree.
2022-12-08 18:46:16 +01:00
..
lib ObjectSpace.dump_all: dump shapes as well 2022-12-08 18:46:16 +01:00
depend ObjectSpace.dump_all: dump shapes as well 2022-12-08 18:46:16 +01:00
extconf.rb ext/objspace: Specify frozen_string_literal: true. 2017-02-12 04:31:25 +00:00
object_tracing.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
objspace.c Move error from top_stmts and top_stmt to stmt 2022-10-08 17:59:11 +09:00
objspace.h
objspace_dump.c ObjectSpace.dump_all: dump shapes as well 2022-12-08 18:46:16 +01:00