finalizer_table.
* gc.c (rb_gc_call_finalizer_at_exit): warns when could not invoke
finalizers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: fix deferred finalizer system. finalize processes of
T_DATA and T_FILE are executed after gc process.
And fix to use BUILTIN_TYPE() instead of seeing flag.
* thread.c, vm_core.h: add RUBY_VM_SET_FINALIZER_INTERRUPT()
and check intterupt_flag at rb_thread_execute_interrupts().
* thread.c (mutex_mark): fix to mark next_mutex.
* vm.c (rb_thread_mark): fix to mark keeping_mutexes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(garbage_collect_force) : mark and lazysweep invoke, after erasing all mark.
(GC_NOT_LAZY_SWEEP) : not lazy sweep flag. for debug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
table until run.
* gc.c (rb_gc_call_finalizer_at_exit): deferred_final_list may be
empty first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
str and len by src.
* gc.c (gc_mark_children): mark src field of regexp.
(obj_free): don't free str field.
* re.c (REG_BUSY): removed.
(rb_reg_initialize): prohibit re-initialize regexp.
(rb_reg_search): use usecnt to prevent freeing regexp currently
using. this prevents SEGV by:
r = /\A((a.)*(a.)*)*b/
r =~ "ab" + "\xc2\xa1".force_encoding("euc-jp")
t = Thread.new { r =~ "ab"*8 + "\xc2\xa1".force_encoding("utf-8")}
sleep 0.2
r =~ "ab"*8 + "\xc2\xa1".force_encoding("euc-jp")
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
exceptions.
* eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freeze
preallocated special exceptions.
* eval.c (rb_longjmp): duplicate the thrown exception to set backtrace
if it was frozen.
* gc.c (rb_memerror): raise nomem_error without backtrace if failed to
make backtrace.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This option enables to calculate exact size of current
allocated size by malloc(). You can access these information
with GC.malloc_allocated_size and GC.malloc_allocations.
This option consume additional memory as a header of each memory
object. This option also helps to find out xmalloc()/xfree()
consistency. If you get trouble with this option, some extension
using "free()" instead of "xfree()".
This options is disabled by default.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
succeeds. failed malloc size can be huge. it may increase
malloc_limit too big which cause less GC and memory full.
(ruby_vm_xrealloc): ditto.
(rb_objspace): make params.limit and params.increase size_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
determining heaps_inc from heaps_used, not objects_delta.
(struct rb_objspace): delta removed. change increment, length and
used to long for LP64.
(objects_delta): removed.
(allocate_heaps): add next_heaps_length argument.
(init_heap): renamed from add_heap.
(garbage_collect): use heaps_increment in dont_gc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Init_BareVM): per-VM object space support, which is disabled now.
* gc.c (rb_objspace_alloc), vm.c (Init_BareVM): should not use ruby
malloc here.
* gc.c (garbage_collect, etc): performance improvement by passing the
reference instead of refering the global variable in each functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reduce malloc() call.
* gc.c (HEAP_SIZE): use smaller heap segment (2K) for more chance
to be freed. based on patch from authorNari <authornari at gmail.com>.
* gc.c (rb_newobj_from_heap): eventually allocate heap segments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (mark_current_machine_context): check if the main thread stack
position may shink under the intialized position. [ruby-core:16436]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e