should use ATOMIC_EXCHANGE() to check the previous value.
[ruby-dev:44596] [Bug #5439]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
object setup to get rid of rare-but-potential memory leak.
* gc.c (gc_mark_children): skip marking extended members if ptr is
NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
if -w/-v options are specified. these messages are output to stderr,
not to stdout. [ruby-core:39795] [Bug #5380]
* test/ruby/test_gc.rb (test_gc_parameter): add test for it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS.
[ruby-core:39777] [Bug #5380]
* test/ruby/test_gc.rb (test_gc_parameter): add test for it.
* test/ruby/envutil.rb (assert_normal_exit): add :child_env option to
enable pass environemnt variables to child process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
define macros only if they are not defined.
fixes: [Ruby 1.9 - Feature #5291]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
sweeping, and to it cannot come back since other objects
referred from it might have been freed already.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
try heap_increment() because it might be able to expand the
heap. [Bug #5127] [ruby-dev:44285]
* gc.c (gc_clear_mark_on_sweep_slots): if a sweeping was
interrupted, we expand the heap if at all possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-dev:44315] [Bug #5139]
* vm.c (thread_free): use free because objspace is not ready.
* vm.c (th_init): use malloc because objspace is not ready.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(rb_gc_mark_unlinked_live_method_entries): fix SEGV bug.
rb_method_entry_t was free'd even when the method is still on the
stack if it is BMETHOD (i.e., Method#call). This is because
rb_method_entry_t is embedded in struct METHOD. This commit
separates them and marks the live method entries.
See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
gc_mark(lev <= GC_LEVEL_MAX) in gc_mark().
In ruby_stack_check(), water_mark is a value that may call some
C function. Fixes Bug #3781
* configure.in: define GC_MARK_STACKFRAME_WORD that approximate
size of gc_mark() and gc_mark_children() stackframes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
return NULL if it's passed 0. But some caller don't expect it.
patch by Yutaka Kanemoto.
(vm_malloc_prepare): return calculated size.
(vm_xmalloc): use above result.
(vm_xcalloc): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
type check to get rid of a double free when main Thread has singleton
class. [ruby-core:36741] [Bug #4828]
* thread.c (rb_obj_is_mutex): add a new utility function.
* vm.c (rb_obj_is_thread): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
environment variables. based on a patch from funny-falcon at
https://gist.github.com/856296, but honors safe level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
thread to free.
* gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if
there is no current thread.
[ruby-dev:43000]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
possible for an object to survive until its surrounding object
space is about to be freed. Those objects, if any, remains not
leaked for the rest of a process life. This is problematic
because for instance a T_DATA object may have its own destructor
to terminate something.
* vm.c (ruby_vm_destruct): ruby_current_vm termination should be
somewhere after rb_objspace_free for above reason.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e