summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2009-07-07* gc.c (rb_gc_call_finalizer_at_exit): deal with typed struct likenobu
as obj_free(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07* gc.c (GC_PROF_SET_MALLOC_INFO, GC_PROF_SET_HEAP_INFO): simplified.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-23* gc.c: remove the definition of GC_DEBUG (debugging macro).mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16fix indent.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16* include/ruby/ruby.h: New structure RTypedData, added.ko1
This structure incldues more explicit type information for T_DATA objects. If RData(obj)->dfree is immediate value `1' on T_DATA object obj, obj is needed to be accessed with RTYPEDDATA(obj) instead of RDATA(obj). A RTypedData structure points the structure rb_typed_data_t. rb_typed_data_t includes information such as the type name of this data, mark and free function what RData includes, and memsize function show how data consuming the memory size. Note that you do not need any change existing T_DATA objects. If you use RDataType instead of RData on T_DATA object, you can specify explicit type information. * gc.c (rb_data_typed_object_alloc, rb_objspace_data_type_memsize, rb_objspace_data_type_name): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16* gc.c: fix indent.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16* gc.c (rb_objspace_each_objects): New C API, added.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-15* gc.c (os_obj_of): invoke garbage collection before iteration, tomatz
avoid accessing half recycled object references. [ruby-dev:38613] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-26* gc.c: fixed types.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-13* gc.c: add longlife garbage collection. [ruby-dev:38423]nari
(NORMAL_HEAPS_USED): new macro. (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto. (add_longlife_heaps_slot): new function. (rb_newobj_from_longlife_heap): ditto. (rb_newobj_longlife): ditto. (rb_node_newnode_longlife): ditto. (rb_gc_write_barrier): ditto. (remembered_set_recycle): ditto. (rb_gc_mark_remembered_set): ditto. (clear_mark_longlife_heaps): ditto. (gc_sweep_for_longlife): ditto. (assign_heap_slot): new argumnent to longlife heaps slot. (add_freelist): ditto. (gc_sweep): avoid lonlife heap slot. set longlife_collection flag at add heap. (rb_gc_force_recycle): avoid mark object and remembered_set object. (garbage_collect): add longlife collection. (rb_gc_start): invoke longlife collection. (gc_profile_record_get): for longlife collction profile. (gc_profile_result): ditto. * include/ruby/intern.h (rb_gc_write_barrier): declared. * include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED. * debug.c (FL_REMEMBERED_SET): ditto. * insns.def (setinlinecache): insert write barrier. * vm_insnhelper.c (vm_method_search): ditto. * set_relation (set_relation): use longlife object. * vm.c (vm_define_method): ditto. * vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto. * vm_method.c (rb_add_method): ditto. * class.c (rb_add_method): ditto. * node.h (NEW_NODE_LONGLIFE): new macro. (rb_node_newnode_longlife): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-19* eval.c (ruby_cleanup): the order of local variables on stack isnobu
undefined. should use outermost VALUE for ruby_init_stack. * gc.c (ruby_get_stack_grow_direction, Init_stack): allows volatile pointer. * thread_*.c (ruby_init_stack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23* gc.c (init_heap): set default to heap slots lengthnari
if HEAP_OBJ_LIMIT is larger than HEAP_MIN_SLOTS. [Bug #1310] (set_heaps_increment): increment next_heaps_length if next_heaps_length and heaps_used are same. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-13* configure.in (AC_HEADER_DIRENT): added.nobu
* include/ruby/ruby.h (NUM2INT, rb_special_const_p): returns true and false instead of Qtrue and Qfalse for platforms where VALUE is bigger than int. * gc.c (gc_stress_set), ext/openssl/ossl_asn1.c (decode_bool): got rid of variables named `bool'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12* array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10* array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,nobu
missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27* gc.c (ruby_get_stack_grow_direction): no needs to use threadnobu
here, and not initialized yet. [ruby-core:22439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14* string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* gc.c (vm_xmalloc, vm_xrealloc): comparisons had no meanings onnobu
platforms where size_t is unsigned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 * gc.c (define_final, undefine_final): shouldn't add/remove finalizerusa
of forzen objects. * gc.c (undefine_final): should remove FL_FINALIZE flag. [ruby-dev:37964] (also see [ruby-dev:37959]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22* gc.c (define_final): cannot define finalizer for immediatenobu
values. [ruby-core:21500] * gc.c (define_final): freezes or hides internal values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19* gc.c (garbage_collect_with_gvl): suppress warnings.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15* gc.c (gc_with_gvl): suppress warnings.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-14* gc.c (negative_size_allocation_error_with_gvl): abolish a warning.akr
(negative_size_allocation_error): ditto. * ext/openssl/ossl.c (ossl_raise): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12* gc.c (ruby_xmalloc, ruby_xrealloc, ruby_xfree):ko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09* compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu
(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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27* gc.c (gc_mark): still needs to check stack depth during GC.matz
* gc.c (stack_check): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27* gc.c (ruby_stack_check): no check if using sigaltstack.nobu
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07* include/ruby/io.h (rb_io_t): added write_lock to serialize.nobu
[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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-25* gc.c (gc_profile_result): bug fix. The millisecond is 1/1000.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-09 * include/ruby/ruby.h: embeds the elements of an array into itsyugui
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-06* gc.c (gc_mark_children): ignores T_ZOMBIE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04* dln.c: Ruby no longer supports MS-DOS.yugui
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04* djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.yugui
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04* x68/_dtos18.c: removed. Ruby no longer supports human68k.yugui
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-01* gc.c (rb_gc_call_finalizer_at_exit): finalize deferred IO and Data.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-01* gc.c (rb_gc_call_finalizer_at_exit): deffers IO finalization.nobu
[ruby-dev:36646] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, node.h: move node.h from include path.ko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-20 * complex.c: an instance method image has been removed andtadf
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15* gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09* include/ruby/io.h (rb_io_t): rename field: writeconv_stateless toakr
writeconv_asciicompat. * io.c: follow the renaming. * gc.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz
a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* gc.c (gc_profile_record_get): to static function.nari
(gc_profile_result): ditto. (gc_profile_report): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* vm_core.h (struct rb_vm_struct): replaced signal staff with trapnobu
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03* include/ruby/io.h (rb_io_t): new fields: encs.ecopts andakr
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03* include/ruby/signal.h: removed.ko1
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29* gc.c, include/ruby/ruby.h: rename T_DEFERRED to T_ZOMBIE.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23* include/ruby/io.h (rb_io_t): remove path field and add pathv field.akr
(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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18* include/ruby/io.h (rb_io_t): new fields: writeconv,akr
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14* gc.c (getrusage_time): should return the value.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e