summaryrefslogtreecommitdiff
path: root/test/test_weakref.rb
Commit message (Collapse)AuthorAgeFilesLines
* Pin weakmap referencestenderlove2019-04-091-3/+3
| | | | | | | | Weak map references can't move because the st_table needs their address as a key. But, we also need to remove T_NONE from the map so they aren't reused. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Just a check to see what is breaking in CItenderlove2019-04-091-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/weakref.rb: Specify frozen_string_literal: true.kazu2017-01-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk: exclude memory leak testsnobu2015-09-031-1/+1
| | | | | | | * common.mk (TEST_EXCLUDES): exclude tests for memory leak, often too expensive and/or false-positive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_weakref.rb: increase timeout [Bug #10618]normal2014-12-191-1/+1
| | | | | | | * test/test_weakref.rb (test_repeated_object_leak): increase timeout [Bug #10618] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (define_final0): avoid duplicate blocksnormal2014-12-131-0/+8
| | | | | | | | | | | This prevents excessive memory growth when a WeakRef is repeatedly created * gc.c (define_final0): avoid duplicate blocks [Bug #10537] * test/test_weakref.rb (test_repeated_object_leak): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_weakref.rb: find collected weakrefnobu2014-01-101-3/+8
| | | | | | | * test/test_weakref.rb (test_recycled): retry and find a WeakRef whose the target is collected, to fix circumstance dependent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_weakref.rb: use single level WeakRefnobu2013-12-121-9/+10
| | | | | | | | | | | | * test/test_weakref.rb (make_weakref): return single level WeakRef, instead of multiple level, since the second level object may be still alive even after the final object get finalized, in test_recycled. * test/test_weakref.rb (test_ref): move living object assertions from test_recycled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: fix aritynobu2013-10-181-0/+2
| | | | | | | * gc.c (Init_GC): fix arity of key? method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix WeakRef finalizeshirosaki2012-11-241-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c (rb_ary_delete_same_obj): new function for WeakRef. This deletes same objects as item argument in the array. * internal.h (rb_ary_delete_same_obj): add a declaration. * gc.c (wmap_final_func): remove WeakRef object reference from the array. rb_ary_delete() is not usable because it uses rb_equal() to compare object references. * gc.c (wmap_finalize): remove recycled object references from weak map hash properly. How to get object reference from object id was wrong. st_delete() doesn't work properly if key and value arguments are same. The key of obj2wmap is referenced object and the value of obj2wmap is WeakRef array. * gc.c (wmap_aset): obj2wmap should contain WeakRef array in the definition. * test/test_weakref.rb (TestWeakRef#test_not_reference_different_object, TestWeakRef#test_weakref_finalize): add tests for above. [ruby-core:49044] [Bug #7304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rvert r37827 and r37828naruse2012-11-241-19/+0
| | | | | | | | | | | Revert "Fix finalize of WeakRef" This causes segv on rubyspec. http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20121124T050101Z.log.html.gz you can reproduce by make test-rubyspec MSPECOPT='-V library/weakref' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix finalize of WeakRefshirosaki2012-11-241-0/+19
| | | | | | | | | | | | | | | | | | | | | * gc.c (wmap_final_func): remove WeakRef object reference from the array. * gc.c (wmap_finalize): remove recycled object references from weak map hash properly. How to get object reference from object id was wrong. st_delete() doesn't work properly if key and value arguments are same. The key of obj2wmap is referenced object and the value of obj2wmap is WeakRef array. * gc.c (wmap_aset): obj2wmap should contain WeakRef array in the definition. * test/test_weakref.rb (TestWeakRef#test_not_reference_different_object): add a test for above. [ruby-core:49044] [Bug #7304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* more GCablenobu2012-03-141-2/+4
| | | | | | * test/test_weakref.rb (make_weakref): more GCable, probably. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Bug #5350nobu2012-03-131-0/+22
* gc.c: add ObjectSpace::WeakMap. [ruby-dev:44565][Bug #5350] * lib/weakref.rb: use WeakMap instead of _id2ref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e