summaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.nobu2008-06-131-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_stack_check): STACK_LENGTH should be less thannobu2008-06-131-3/+2
| | | | | | | STACK_LEVEL_MAX. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (Init_stack): make to call ruby_init_stack.nobu2008-06-091-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: add a build option "CALC_EXACT_MALLOC_SIZE".ko12008-06-081-52/+113
| | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@17018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko12008-06-081-20/+20
| | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (count_objects): clear hash after counting objects.akr2008-06-061-4/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_alloc): this function is needed only whenmame2008-06-051-0/+2
| | | | | | | | | ENABLE_VM_OBJSPACE macro is defined. * vm.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (os_obj_of): heaps may be modified in yield.akr2008-06-051-5/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (count_objects): clear given hash.akr2008-05-311-0/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (PRI[diouxX]VALUE): printf format for VALUE.nobu2008-05-201-1/+1
| | | | | | | * gc.c (assign_heap_slot): suppress a warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.ko12008-05-191-14/+1
| | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_vm_xmalloc): increase malloc_increase only if mallocakr2008-05-121-5/+5
| | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@16388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (assign_heap_slot): fix condition for number of objects inakr2008-05-121-1/+1
| | | | | | | a heap. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (assign_heap_slot): put the binary-search routine in order.yugui2008-05-121-15/+14
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (SIZET2NUM): new macro.akr2008-05-111-31/+32
| | | | | | | | | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@16356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_count): rdoc corrected.yugui2008-05-101-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (set_heaps_increment): fix memory allocation strategy byakr2008-05-041-20/+15
| | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@16289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_count): add a GC.count method. This method returnsko12008-04-271-0/+19
| | | | | | | | a GC invoking count. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (rb_vm_t), gc.c (rb_objspace, rb_newobj), vm.cnobu2008-04-271-136/+220
| | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@16218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (builtin_types), gc.c (count_objects): added Complex andnobu2008-04-261-23/+27
| | | | | | | Rational. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h, gc.c: remove T_BLOCK.ko12008-04-261-3/+0
| | | | | | | | * include/ruby/ruby.h: re-number T_xxx. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (free_unused_heaps): preserve last used heap segment tomatz2008-04-251-55/+138
| | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@16194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_xmalloc): use size_t for malloc argument instead of long.usa2008-04-201-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_mark_locations): get rid of underflow.nobu2008-04-181-3/+3
| | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@16072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_stack): use ruby_init_stack. [ruby-dev:34350]nobu2008-04-141-59/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_t): packed globals. [ruby-dev:34348]nobu2008-04-141-25/+69
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (finalizers): removed. [ruby-dev:34349]nobu2008-04-141-67/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):nobu2008-04-121-48/+0
| | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (RUBY_SETJMP, RUBY_LONGJMP, RUBY_JMP_BUF): prefersnobu2008-03-311-10/+6
| | | | | | | | | | | | | | | __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: http://svn.ruby-lang.org/repos/ruby/trunk@15871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* both complex and rational are now builtin classes.tadf2008-03-161-0/+15
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_intern.h (rb_thread_raised_set): use generic flags.nobu2008-03-121-4/+5
| | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@15756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: fixed indent.nobu2008-03-121-9/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: removed trailing spaces.nobu2008-03-121-5/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz2008-03-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (add_heap): fix previous change. [ruby-dev:33988]akr2008-03-041-2/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (add_heap): use binary search to find the place to insert thenobu2008-03-041-19/+32
| | | | | | | new heap slot. [ruby-dev:33983] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (add_heap): sort heaps array in ascending order to usematz2008-03-031-7/+27
| | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@15674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.akr2008-02-251-4/+4
| | | | | | | | | | | | | | | | (ROBJECT_IVPTR): renamed from ROBJECT_PTR. * variable.c: follow the above renaming. * object.c: ditto. * gc.c: ditto. * marshal.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (STACK_LENGTH) [SPARC] : 0x80 offset removed. [ruby-dev:33857]akr2008-02-191-3/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/re.h (struct rmatch_offset): new struct for characterakr2008-02-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@15513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, gc.c (setjmp): sigsetjmp is a macro on cygwin.nobu2008-01-211-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (sigsetjmp): check if available.nobu2008-01-191-1/+1
| | | | | | | * eval.c, gc.c (setjmp): do not use _setjmp if sigsetjmp is available. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (os_obj_of): returns an enumerator if no block given. based onnobu2007-12-281-1/+2
| | | | | | | a patch from Yugui <yugui AT yugui.sakura.ne.jp>. [ruby-dev:32828] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_garbage_collect): new function for debugging.akr2007-12-211-0/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (rb_thread_t): new member machine_stack_maxsize andakr2007-12-151-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | machine_register_stack_maxsize. * gc.c (rb_gc_stack_maxsize): new global variable for the thread size of the main thread. (STACK_LEVEL_MAX): use machine_stack_maxsize of current thread. (ruby_stack_check): check IA64 register stack. (ruby_set_stack_size): set rb_gc_stack_maxsize. (Init_stack): set rb_gc_stack_maxsize. * thread_pthread.ci (native_thread_create): initialize th->machine_stack_maxsize and th->machine_register_stack_maxsize. * vm.c (Init_BareVM): initialize th->machine_stack_maxsize and th->machine_register_stack_maxsize. * thread_win32.ci (native_thread_create): initialize th->machine_stack_maxsize. not tested. just a guess at all. [ruby-dev:32604] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (expr): redefinable not (!) operator.matz2007-12-091-1/+0
| | | | | | | | | | | | * parse.y (arg): ditto. * object.c (rb_obj_not): new method "!". * object.c (rb_obj_not_equal): new method "!=". * object.c (rb_obj_not_match): new method "!~". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_children): obj->as.file.fptr may be 0 for T_FILE.akr2007-11-201-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): add tied_io_for_writing member.akr2007-11-201-0/+4
| | | | | | | | | | | | | * io.c: use tied_io_for_writing for duplex popen. * gc.c: mark tied_io_for_writing. * common.mk: gc.o depends io.h. [ruby-dev:32205] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (count_objects): count TOTAL.akr2007-11-031-1/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e