summaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * gc.c (ruby_get_stack_grow_direction): no needs to use threadnobu2009-02-271-3/+3
| | | | | | | here, and not initialized yet. [ruby-core:22439] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-8/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame2009-02-141-1/+0
| | | | | | | | | | | | include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (vm_xmalloc, vm_xrealloc): comparisons had no meanings onnobu2009-02-121-2/+2
| | | | | | | platforms where size_t is unsigned. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (define_final, undefine_final): shouldn't add/remove finalizerusa2009-02-111-0/+3
| | | | | | | | | | | of forzen objects. * gc.c (undefine_final): should remove FL_FINALIZE flag. [ruby-dev:37964] (also see [ruby-dev:37959]) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (define_final): cannot define finalizer for immediatenobu2009-01-221-2/+9
| | | | | | | | | values. [ruby-core:21500] * gc.c (define_final): freezes or hides internal values. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (garbage_collect_with_gvl): suppress warnings.ko12009-01-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_with_gvl): suppress warnings.ko12009-01-151-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (negative_size_allocation_error_with_gvl): abolish a warning.akr2009-01-141-2/+2
| | | | | | | | | | (negative_size_allocation_error): ditto. * ext/openssl/ossl.c (ossl_raise): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_xmalloc, ruby_xrealloc, ruby_xfree):ko12009-01-121-8/+82
| | | | | | | | | | enable to use them without GVL. if GC is invoked, acquire GVL during GC. if NoMemoryError is raised, acquire GVL and raise it. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu2008-12-091-2/+2
| | | | | | | | | | | | | (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), (thread_start_func_2, blocking_region_begin, blocking_region_end), (rb_thread_kill), thread_pthread.c (native_thread_create), (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), (vm_call0): use void pointer for %p. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark): still needs to check stack depth during GC.matz2008-11-271-6/+12
| | | | | | * gc.c (stack_check): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_stack_check): no check if using sigaltstack.nobu2008-11-271-0/+4
| | | | | | | | | | | | | | | | * signal.c (register_sigaltstack): minimum size is insufficient for method calls. * signal.c (sigsegv): handles stack overflow if possible. * thread.c (ruby_thread_stack_overflow): helper function to raise sysstack_error. * thread_pthread.c (ruby_stack_overflowed_p): checks for stack overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): added write_lock to serialize.nobu2008-11-071-1/+3
| | | | | | | | | | | | | | [ruby-core:19668] * gc.c (gc_mark_children): mark write_lock. * gc.c (rb_gc_call_finalizer_at_exit): Mutex also needs to be deferred. * io.c (io_fflush, io_binwrite, fptr_finalize): serializes writing. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_result): bug fix. The millisecond is 1/1000.nari2008-10-251-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: embeds the elements of an array into itsyugui2008-10-091-1/+1
| | | | | | | | | | | | | | | | | | struct RArray for # of elements <= 3. * array.c: ditto. * gc.c (gc_mark_children): following the change of struct RArray. * ext/tk/tcltklib.c (ip_ruby_cmp): ditto. * parse.y (coverage): ditto. * proc.c (curry): ditto. * .gdbinit: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_children): ignores T_ZOMBIE.nobu2008-10-061-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports MS-DOS.yugui2008-10-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/sdbm/_sdbm.c: ditto. * ext/sdbm/sdbm.h: ditto. * gc.c: ditto. * hash.c: ditto. * include/ruby/defines.h: ditto. * include/ruby/util.h: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * strftime.c: ditto. * util.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.yugui2008-10-041-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * djgpp/README.djgpp: ditto. * djgpp/config.hin: ditto. * djgpp/config.sed: ditto. * djgpp/configure.bat: ditto. * djgpp/mkver.sed: ditto. * ext/Setup.dj: ditto. * dln.c: removed djgpp supports. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * signal.c: ditto. * util.c: ditto. * vm_core.h: ditto. * lib/fileutils.rb: ditto. * lib/mkmf.rb: ditto. * ext/socket/socket.c: ditto. * test/fileutils/test_fileutils.rb: ditto. * test/ruby/test_env.rb: ditto. * test/ruby/test_path.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * x68/_dtos18.c: removed. Ruby no longer supports human68k.yugui2008-10-041-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * x68/_round.c: ditto. * x68/fconvert.c: ditto. * x68/select.c: ditto. * ext/Setup.x68: ditto. * missing/x68.c: ditto. * dln.c (dln_find_exe_r): removed human68k supports. (dln_find_1): ditto. * lib/mkmf.rb: ditto. * ext/extmk.rb (Init_ext): ditto. * ext/socket/socket.c (init_sock): ditto. * gc.c (GC_MALLOC_LIMIT): ditto. (rb_setjmp, rb_jmpbuf): ditto. (mark_current_machine_context): ditto. * include/ruby/defines.h (PATH_ENV): ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * test/ruby/test_env.rb: ditto. * test/ruby/test_path.rb: ditto. * LEGAL git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_call_finalizer_at_exit): finalize deferred IO and Data.nobu2008-10-011-2/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_call_finalizer_at_exit): deffers IO finalization.nobu2008-10-011-13/+22
| | | | | | | [ruby-dev:36646] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, node.h: move node.h from include path.ko12008-09-231-1/+0
| | | | | | | | | | | | | | This change stop to install node.h beacuase of saving ABI (node.h will be changed. Extensions should not depends on this file). * blockinlining.c, class.c, compile.c, debug.h, enum.c, gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c, vm.c, vm_core.h, vm_dump.c: ditto. * ext/ripper/depend: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: an instance method image has been removed andtadf2008-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | uses "imag" instead of "image". * complex.c: two instance method re and im are removed. * rational.c: follows the above changes. * include/ruby/ruby.h: ditto. * gc.c: ditto. * lib/cmath.rb: ditto. * lib/mathn.rb: ditto. * lib/complex.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko12008-09-151-1/+1
| | | | | | | | | | | | | | to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): rename field: writeconv_stateless toakr2008-09-091-1/+1
| | | | | | | | | | | | writeconv_asciicompat. * io.c: follow the renaming. * gc.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz2008-09-051-4/+4
| | | | | | | a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_record_get): to static function.nari2008-09-041-4/+5
| | | | | | | | | (gc_profile_result): ditto. (gc_profile_report): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (struct rb_vm_struct): replaced signal staff with trapnobu2008-09-041-1/+0
| | | | | | | | | | | | | | | | | | | | staff. * signal.c (signal_buff): per process resouce now. * signal.c (trap_list): moved to VM. * signal.c (rb_get_next_signal): reverted. * signal.c (rb_trap_exit): trap_pending_list was no longer used. * thread.c (timer_thread_function): delivers buffered per-process signals to each VMs. * vm.c (rb_vm_mark): marks trap_list. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): new fields: encs.ecopts andakr2008-09-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writeconv_pre_ecopts. (MakeOpenFile): initialize them. * include/ruby/encoding.h (rb_str_transcode): take ecopts argument. (rb_econv_flags): removed. (rb_econv_prepare_opts): declared. (rb_econv_open_opts): declared. * io.c (make_writeconv): use rb_econv_open_opts. (make_readconv): ditto. (io_fwrite): follow rb_str_transcode change. (rb_io_extract_modeenc): use rb_econv_prepare_opts. (rb_file_open_generic): initialize encs.ecopts. (rb_file_open_internal): ditto. (rb_io_reopen): ditto. (argf_ecopts): defined. (argf_next_argv): set encs.ecopts. (io_encoding_set): use rb_econv_prepare_opts. (argf_set_encoding): set argf_ecopts. * gc.c (gc_mark_children): mark encs.ecopts and writeconv_pre_ecopts in T_FILE. * transcode.c (transcode_loop): take ecopts argument. use rb_econv_open_opts. (rb_econv_flags): removed. (rb_econv_prepare_opts): defined. (rb_econv_open_opts): defined. (str_transcode0): take ecopts. (str_transcode): use rb_econv_prepare_opts. (rb_str_transcode): take ecopts. (econv_init): accept hash argument. (econv_insert_output): follow rb_str_transcode change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/signal.h: removed.ko12008-09-031-16/+16
| | | | | | | | | | | | | | | * common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c, io.c, process.c, signal.c: vm_core.h: ditto. Some unused external global variables are also removed. (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending, rb_thread_critical) * ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c, ext/readline/readline.c, ext/socket/depend, ext/socket/socket.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, include/ruby/ruby.h: rename T_DEFERRED to T_ZOMBIE.ko12008-08-291-7/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): remove path field and add pathv field.akr2008-08-231-0/+1
| | | | | | | | | | | | | | | | (MakeOpenFile): initialize pathv as Qnil. * gc.c: mark pathv field in T_FILE. * io.c: follow the rb_io_t field change. * file.c: ditto. * ext/socket/socket.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): new fields: writeconv,akr2008-08-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writeconv_stateless and writeconv_initialized. (MakeOpenFile): initialize them. * include/ruby/encoding.h (rb_econv_stateless_encoding): declared. (rb_econv_string): declared. * io.c (make_writeconv): new function. (io_fwrite): use econv. (make_readconv): fix error message. (finish_writeconv): new function. (fptr_finalize): call finish_writeconv. (clear_writeconv): new function. (clear_codeconv): new function to call both clear_readconv and clear_writeconv. (rb_io_fptr_finalize): call clear_codeconv instead of clear_readconv. (mode_enc): ditto. (io_set_encoding): ditto. (argf_next_argv): ditto. (io_encoding_set): ditto. * gc.c (gc_mark_children): mark writeconv_stateless in T_FILE. * transcode.c (stateless_encoding_i): new function. (rb_econv_stateless_encoding): ditto. (rb_econv_string): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (getrusage_time): should return the value.nobu2008-08-141-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: count only freed object as freelist size.ko12008-08-131-7/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (getrusage_time): Returned effective value on Windows.kouji2008-08-121-0/+21
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_result): use rb_str_catf.nari2008-08-121-17/+14
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_result): use sprintf.nari2008-08-121-17/+20
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (getrusage_time): works only if RUSAGE_SELF is defined rightnobu2008-08-111-26/+27
| | | | | | | | | now. * gc.c (gc_profile_result): C99. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: added GC::Profiler.nari2008-08-111-0/+339
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (STACK_LEVEL_MAX, ruby_stack_length): returns size_t.nobu2008-08-091-1/+1
| | | | | | | [ruby-core:18207] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (run_final): runs finalizers with the object terminated.nobu2008-08-061-14/+19
| | | | | | | | * gc.c (rb_gc_call_finalizer_at_exit): keeps finalized objects from linking to freelist. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (chain_finalized_object): deletes finalizers to be invoked fromnobu2008-08-061-0/+7
| | | | | | | | | | finalizer_table. * gc.c (rb_gc_call_finalizer_at_exit): warns when could not invoke finalizers. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_call_finalizer_at_exit): self-referencing finalizersnobu2008-08-061-20/+15
| | | | | | | cannot be invoked. [ruby-dev:35681] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (allocate_heaps, assign_heap_slot, rb_newobj_from_heap):mame2008-08-011-2/+8
| | | | | | | reset during_gc before raising NoMemoryError. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_children, obj_free): T_DEFERRED should not be appear.ko12008-07-271-8/+10
| | | | | | | | | * gc.c (gc_sweep, finalize_list): fix to decrement heap_slot#limit after executing finalizer. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: add a type T_DEFERRED.ko12008-07-271-47/+70
| | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@18231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_sweep, obj_free, run_final): defer finalizers of IO andnobu2008-07-251-10/+27
| | | | | | | Data. [ruby-dev:35578] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: revert. before lazy sweep.nari2008-07-051-245/+124
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e