diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 13:12:40 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 13:12:40 +0000 |
commit | 8f136d8a767cf581d5e6f561aecdbed00444f135 (patch) | |
tree | 15b7e40ebf19d9da9088933528df5b36dccb50cb /lib/yaml.rb | |
parent | 6b00ba5ccc6f57c62a2b5f52511beb7acad2ef81 (diff) |
merge revision(s) 16082:
* lib/yaml/types.rb: Likewise, pass self to YAML::quick_emit;
merged from 1.9.
* lib/yaml.rb (quick_emit): use combination of object_id and hash to
identify repeated object references, since GC will reuse memory of
objects during output of YAML. [ruby-Bugs-8548] [ruby-Bugs-3698];
merged from 1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml.rb')
-rw-r--r-- | lib/yaml.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb index fe8335c8f0..a8da42a321 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -384,6 +384,10 @@ module YAML else emitter.reset( opts ) end + oid = + case oid when Fixnum, NilClass; oid + else oid = "#{oid.object_id}-#{oid.hash}" + end out.emit( oid, &e ) end |