summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2008-06-30* gc.c (rb_newobj): abort GC phase before rb_bug.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30* gc.c (chain_finalized_object): should not delete from finalizernobu
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
2008-06-30* gc.c (gc_finalize_deferred): allow object allocation in finalizers.nobu
* gc.c (rb_gc_call_finalizer_at_exit): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 * gc.c (rb_newobj): prohibit call of rb_newobj() during gc whenusa
USE_VALUE_CACHE is not defined (normal case). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-28* include/ruby/ruby.h (struct RRegexp): new field usecnt. replaceakr
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
2008-06-18* gc.c (rb_newobj): prohibit call of rb_newobj() during gc.shyouhei
a patch from Sylvain Joyeux in [ruby-core:12099]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-15* vm_core.h (rb_vm_t), vm.c (rb_vm_mark): moved preallocated specialnobu
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
2008-06-14* gc.h (STACK_UPPER): moved from gc.cnobu
* thread.c, thread_{pthread,win32}.c (ruby_init_stack, ruby_thread_init_stack): moved stack initialization from gc.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13* gc.c (ruby_initial_gc_stress): defined.akr
(ruby_initial_gc_stress_ptr): defined. * debug.c (set_debug_option): use ruby_initial_gc_stress_ptr for gc_stress option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13* gc.c (ruby_gc_stress): moved to rb_objspace_t.nobu
* gc.c (gc_stress_get, gc_stress_set): VM local attribute. * signal.c (sigsegv): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13* gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13* gc.c (ruby_stack_check): STACK_LENGTH should be less thannobu
STACK_LEVEL_MAX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/intern.h (Init_stack): make to call ruby_init_stack.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* gc.c: add a build option "CALC_EXACT_MALLOC_SIZE".ko1
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
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06* gc.c (count_objects): clear hash after counting objects.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-05* gc.c (rb_objspace_alloc): this function is needed only whenmame
ENABLE_VM_OBJSPACE macro is defined. * vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-05* gc.c (os_obj_of): heaps may be modified in yield.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* gc.c (count_objects): clear given hash.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20* include/ruby/ruby.h (PRI[diouxX]VALUE): printf format for VALUE.nobu
* gc.c (assign_heap_slot): suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19* vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.ko1
VM value stack frame of block contains cref information. (dfp[-1] points CREF) * compile.c, eval_intern.h, eval_method.c, load.c, proc.c, vm_dump.h, vm_core.h: ditto. * include/ruby/ruby.h, gc.c: remove T_VALUES because of above changes. * bootstraptest/test_eval.rb, test_knownbug.rb: move solved test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12* gc.c (ruby_vm_xmalloc): increase malloc_increase only if mallocakr
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
2008-05-12* gc.c (assign_heap_slot): fix condition for number of objects inakr
a heap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 * gc.c (assign_heap_slot): put the binary-search routine in order.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-11* include/ruby/ruby.h (SIZET2NUM): new macro.akr
(NUM2SIZET): new macro. * gc.c (struct rb_objspace): use size_t for increment, length and used for 64bit. (allocate_heaps): ditto. (assign_heap_slot): ditto. (set_heaps_increment): ditto. (gc_mark_all): ditto. (is_pointer_to_heap): ditto. (free_unused_heaps): ditto. (gc_sweep): ditto. (os_obj_of): ditto. (rb_gc_call_finalizer_at_exit): ditto. (count_objects): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-10 * gc.c (gc_count): rdoc corrected.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-04* gc.c (set_heaps_increment): fix memory allocation strategy byakr
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
2008-04-27* gc.c (gc_count): add a GC.count method. This method returnsko1
a GC invoking count. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-27* vm_core.h (rb_vm_t), gc.c (rb_objspace, rb_newobj), vm.cnobu
(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
2008-04-26* error.c (builtin_types), gc.c (count_objects): added Complex andnobu
Rational. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26* include/ruby/ruby.h, gc.c: remove T_BLOCK.ko1
* include/ruby/ruby.h: re-number T_xxx. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-25* gc.c (free_unused_heaps): preserve last used heap segment tomatz
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
2008-04-20 * gc.c (ruby_xmalloc): use size_t for malloc argument instead of long.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-18* gc.c (rb_gc_mark_locations): get rid of underflow.nobu
* 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
2008-04-14* gc.c (Init_stack): use ruby_init_stack. [ruby-dev:34350]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* gc.c (rb_objspace_t): packed globals. [ruby-dev:34348]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* gc.c (finalizers): removed. [ruby-dev:34349]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):nobu
use iseq instead of NODE. * gc.c (source_filenames): removed. * include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free, ripper_initialize): rb_source_filename() is no longer used. * compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos, parser_warn, e_option_supplied, warn_unless_e_option, range_op, cond0): nd_file is no longer used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31* configure.in (RUBY_SETJMP, RUBY_LONGJMP, RUBY_JMP_BUF): prefersnobu
__builtin_setjmp, _setjmp over setjmp and sigsetjmp. [ruby-core:16023], [ruby-core:16086] * configure.in (--with-setjmp-type): new option to override the default rule in the above. * eval_intern.h (ruby_setjmp, ruby_longjmp), gc.c (rb_setjmp), vm_core.h (rb_jmpbuf_t): use RUBY_SETJMP, RUBY_LONGJMP and RUBY_JMP_BUF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16both complex and rational are now builtin classes.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-12* eval_intern.h (rb_thread_raised_set): use generic flags.nobu
* eval.c (rb_longjmp): clear all raised flags. * eval.c (stack_check): leave clearing flag to rb_longjmp. * gc.c (rb_memerror): use thread raised flag instead of static flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-12* gc.c: fixed indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-12* gc.c: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05* numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz
given. * bignum.c (rb_big_to_s): ditto. * enum.c (enum_first): ditto. * eval_jump.c (rb_f_catch): ditto. * io.c (rb_obj_display): ditto. * class.c (rb_obj_singleton_methods): ditto. * object.c (rb_class_initialize): ditto. * random.c (rb_f_srand): ditto. * range.c (range_step): ditto. * re.c (rb_reg_s_last_match): ditto. * string.c (rb_str_to_i): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_chomp_bang): ditto. * string.c (rb_str_sum): ditto. * string.c (str_modifiable): declare inline. * string.c (str_independent): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-04* gc.c (add_heap): fix previous change. [ruby-dev:33988]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-04* gc.c (add_heap): use binary search to find the place to insert thenobu
new heap slot. [ruby-dev:33983] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-03* gc.c (add_heap): sort heaps array in ascending order to usematz
binary search. * gc.c (is_pointer_to_heap): use binary search to identify object in heaps. works better when number of heap segments grow big. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-25* include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.akr
(ROBJECT_IVPTR): renamed from ROBJECT_PTR. * variable.c: follow the above renaming. * object.c: ditto. * gc.c: ditto. * marshal.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-19* gc.c (STACK_LENGTH) [SPARC] : 0x80 offset removed. [ruby-dev:33857]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-16* include/ruby/re.h (struct rmatch_offset): new struct for characterakr
offsets. (struct rmatch): new struct. (struct RMatch): reference struct rmatch. (RMATCH_REGS): new macro. * re.c (match_alloc): initialize struct rmatch. (pair_byte_cmp): new function. (update_char_offset): update character offsets. (match_init_copy): copy regexp and character offsets. (match_sublen): removed. (match_offset): use update_char_offset. (match_begin): ditto. (match_end): ditto. (rb_reg_search): make character offset updated flag false. (match_size): use RMATCH_REGS. (match_backref_number): ditto. (rb_reg_nth_defined): ditto. (rb_reg_nth_match): ditto. (rb_reg_match_pre): ditto. (rb_reg_match_post): ditto. (rb_reg_match_last): ditto. (match_array): ditto. (match_aref): ditto. (match_values_at): ditto. (match_inspect): ditto. * string.c (rb_str_subpat_set): use RMATCH_REGS. (rb_str_sub_bang): ditto. (str_gsub): ditto. (rb_str_split_m): ditto. (scan_once): ditto. * gc.c (obj_free): free character offsets. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e