diff options
author | John Hawthorn <john@hawthorn.email> | 2019-10-31 17:21:01 -0700 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2019-11-07 09:31:07 -0800 |
commit | b99833baec2e567e38758f4fd017c90c7ce57d75 (patch) | |
tree | 8ee5685fcf5240e8f5ef8f6be6d5e8c1c1640af1 /test/psych/test_null.rb | |
parent | d62abc47c83a79687a41f375338564ece0f403ce (diff) | |
download | ruby-b99833baec2e567e38758f4fd017c90c7ce57d75.tar.gz |
Use a monotonically increasing number for object_id
This changes object_id from being based on the objects location in
memory (or a nearby memory location in the case of a conflict) to be
based on an always increasing number.
This number is a Ruby Integer which allows it to overflow the size of a
pointer without issue (very unlikely to happen in real programs
especially on 64-bit, but a nice guarantee).
This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby
objects to Ruby objects (previously they were Ruby object to C integer)
which simplifies updating them after compaction as we can run them
through gc_update_table_refs.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Diffstat (limited to 'test/psych/test_null.rb')
0 files changed, 0 insertions, 0 deletions