summaryrefslogtreecommitdiff
path: root/thread.c
AgeCommit message (Collapse)Author
2015-01-28thread.c: micro-optimize thread create/joinnormal
* thread.c (struct join_arg): restructure and make smaller (thread_join_sleep): avoid timeofday() call if forever (thread_join): pass join_arg.delay directly (rb_thread_inspect_msg): remove, inline into rb_thread_inspect (rb_thread_inspect): reduce branching and string creation * thread_pthread.c (native_set_thread_name): create string directly to avoid reparsing. [Misc #10723] This reduces time in benchmark/bm_vm_thread_create_join.rb by a few percent. Minor improvements only: target 0: 2.1.5 (ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]) target 1: trunk (ruby 2.3.0dev (2015-01-16 trunk 49282) [x86_64-linux]) target 2: built (ruby 2.3.0dev (2015-01-16 trunk 49282) [x86_64-linux]) benchmark results: minimum results in each 3 measurements. Execution time (sec) name 2.1.5 trunk built vm_thread_create_join 1.049 1.242 1.138 Speedup ratio: compare with the result of `2.1.5' (greater is better) name trunk built vm_thread_create_join 0.845 0.923 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-28* thread.c: Improve documentation for Thread#valuehsbt
[Bug #10694][ruby-core:67324][ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-23hash.c: move Hash specific functionsnobu
* hash.c (rb_ident_hash): move compare_by_identity specific function from st.c. * hash.c (rb_ident_hash_new): ditto from thread.c. * st.c (st_numhash): remove ruby's Hash specific implementation. * thread.c (recursive_list_access): use rb_ident_hash_new(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-29thread.c: fix dynamic symbol keysnobu
* thread.c (rb_thread_variable_get): fix dynamic symbol keys. rb_check_id() returns non-zero only for static symbols, whereas thread local variable keys can be dynamic symbols. [ruby-core:67185] [Bug #10667] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24* hash.c (rb_hash_delete): return Qnil if there are no correspondingko1
entry. [Bug #10623] * hash.c (rb_hash_delete_entry): try delete and return Qundef if there are no corresponding entry. * internal.h: add rb_hash_delete_entry()'s declaration. * symbol.c: use rb_hash_delete_entry(). * thread.c: use rb_hash_delete_entry(). * ext/-test-/hash/delete.c: use rb_hash_delete_entry(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-21thread.c: no allocation during GCnobu
* thread.c (ruby_thread_stack_overflow): jump without setting up the exception not to allocate new objects, during GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-10thread.c: use the same method namenobu
* thread.c (exec_recursive): use the same last method name as recursive_push in the error message when recursive_pop failed. [ruby-core:66742] [Bug #10579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-09thread.c: get rid of invalid ID symbolnobu
* eval.c (rb_frame_last_func): return the most recent frame method name. * thread.c (recursive_list_access): use the last method name, instead of the current method name which can be unset in some cases, not to use a symbol by the invalid ID. [ruby-core:66742] [Bug #10579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-06thread.c (do_select): rename parameters to avoid shadowingnormal
Sometimes we may use write(2) syscalls for debugging inside this function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01use 0 for reservednobu
use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-27* vm_core.h: add rb_thread_t::local_storage_recursive_hashko1
to speed up Thread#[:__recursive_key__] access. [Bug #10511] * thread.c (threadptr_local_aref): add fast path for :__recursive_data__. * thread.c (threadptr_recursive_hash, threadptr_recursive_hash_set): add special accessor for recursive hash. * cont.c: store/restore local_storage_recursive_hash. * vm.c: init and mark local_storage_recursive_hash. * vm_trace.c (rb_threadptr_exec_event_hooks_orig): clear and restore local_storage_recursive_hash directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18* internal.h: Gather declarations in non-header files.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10thread.c: fix for older gccnobu
* thread.c (only_if_constant): get rid of __builtin_choose_expr() on older gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10ruby/ruby.h: eliminate disabled function callnobu
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): eliminate function call for warning/error if not match to get rid of unconditional warning/error by a certain compiler option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07normalize reference to Timeout::Errornormal
From: John Bachir <j@jjb.cc> * bootstraptest/test_io.rb (assert_finish): normalize rescue for Timeout::Error * lib/net/ftp.rb (Net#read_timeout): ditto for doc * lib/resolv.rb (Resolv::ResolvTimeout): ditto for subclass * lib/webrick/httprequest.rb (_read_data): ditto for rescue * sample/timeout.rb (p timeout): ditto for call * test/drb/drbtest.rb (test_06_timeout): ditto * test/ruby/test_readpartial.rb (test_open_pipe): ditto * test/thread/test_queue.rb (test_queue_thread_raise): ditto * thread.c (rb_thread_s_handle_interrupt): ditto for doc [ruby-core:65481] [misc #10339] TimeoutError is a legacy constant, Timeout::Error is the canonical constant. This patch normalizes all code and comments to reference Timeout::Error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-21* thread_pthread.c (native_set_thread_name): New function toakr
set thread name visible with ps command on GNU/Linux. Ex. ps -o %c -L * thread.c (thread_start_func_2): Call native_set_thread_name at beginning. (rb_thread_inspect_msg): Extract from rb_thread_inspect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-11* vm.c (rb_vm_register_special_exception): make new function toko1
make and register special exceptions. * vm.c (rb_vm_mark): do not need to mark special exceptions because they are registerd by rb_gc_register_mark_object(). * eval.c (Init_eval): use rb_vm_register_special_exception(). * gc.c (Init_GC): ditto. * proc.c (Init_Proc): ditto. * thread.c (Init_Thread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-30thread.c, vm_method.c: avoid inadvertent pin-downnobu
* thread.c (rb_thread_variable_set): get rid of inadvertent dynamic symbol pin-down. * vm_method.c (obj_respond_to): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-30thread.c: fix indentnobu
* thread.c (threadptr_local_aset): fix indent, remove unnecessary braces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-20thread.c: use RUBY_VM_CHECK_INTSnobu
* thread.c (rb_thread_schedule): use dedicated macro RUBY_VM_CHECK_INTS(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-09* parse.y: change Symbol <-> ID relationship to avoidko1
exposing IDs from collectable symbols. [Bug #10014] Now, rb_check_id() returns 0 if corresponding symbol is pinned dynamic symbol. There is remaining intern_cstr_without_pindown(), it can return IDs from collectable symbols. We must be careful to use it (only used in parse.y). I think it should be removed if it does not have impact for performance. * parse.y: add: * STATIC_SYM2ID() * STATIC_ID2SYM() rename: * rb_pin_dynamic_symbol() -> dsymbol_pindown() * internal.h: remove: * rb_check_id_without_pindown() * rb_sym2id_without_pindown() add: * rb_check_symbol() * rb_check_symbol_cstr() * load.c: use rb_check_id() or rb_check_id_cstr(). * object.c: ditto. * struct.c: ditto. * thread.c: ditto. * vm_method.c: ditto. * string.c (sym_find): use only rb_check_symbol(). * sprintf.c (rb_str_format): use rb_check_symbol_cstr(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-13* vm_trace.c: clear and restore recursive checking thread local datako1
to avoid unexpected throw from TracePoint. [Bug #9940] * test/ruby/test_settracefunc.rb: add a test. * thread.c: adde * rb_threadptr_reset_recursive_data(rb_thread_t *th); * rb_threadptr_restore_recursive_data(rb_thread_t *th, VALUE old); * vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-11thread.c: fix for non-scalar pthread_tnobu
* configure.in (rb_cv_scalar_pthread_t): pthread_t is not required to be a scalar type. * thread.c (fill_thread_id_string, thread_id_str): dump pthread_t in hexadecimal form if it is not a scalar type, assume it can be represented in a pointer form otherwise. based on the patch by Rei Odaira at [ruby-core:62867]. [ruby-core:62857] [Bug #9884] * thread_pthread.c (Init_native_thread, thread_start_func_1), (native_thread_create): set thread_id_str if needed. * vm_core.h (rb_thread_t): add thread_id_string if needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-11thread_pthread.c: timer thread flagnobu
* thread_pthread.c (timer_thread): add a flag to tell timer thread is created, since 0 may be a valid value as pthread_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-11thread.c: fix thread ID formatnobu
* thread.c (DEBUG_OUT): fix format specifier for a thread ID, which is DWORD not pointer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-31* thread.c (rb_thread_atfork_internal): My compiler complainsshyouhei
about this variable being used before initialized. I looked at the code and expanded the macro and turned out it was actually USED for pointer arithmetic, not dereferenced. So this was never a serious bug. But is annoying indeed to see warnings every time. I added `=0` and all went healthy. * configure.in: Also, I found that the problematic macro expansion only happens when we lack __typeof__ C extension, which shall not be the case of my compiler. I added AC_CTYPEOF to kick ass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-29* vm_trace.c, vm.c, thread.c: get rid of (maybe false positive) warnings aboutusa
using uninitialized var with VC++. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28vm.c: remove rb_vm_living_threads_foreach functionnormal
Shorter code with fewer callbacks and casts should be more readable. * vm.c (rb_vm_living_threads_foreach): remove function [ruby-core:62745] * thread.c (terminate_i): remove * thread.c (terminate_all): implement (inlines old terminate_i) * thread.c (rb_thread_terminate_all): use terminate_all * thread.c (rb_thread_fd_close_i): remove * thread.c (rb_thread_fd_close): iterate inline * thread.c (thread_list_i): remove * thread.c (rb_thread_list): iterate inline * thread.c (rb_thread_atfork_internal): iterate inline * thread.c (terminate_atfork_i): update types to remove casts * thread.c (terminate_atfork_before_exec_i): ditto * thread.c (struct thgroup_list_params): remove definition * thread.c (thgroup_list_i): remove * thread.c (thgroup_list): iterate inline * thread.c (check_deadlock_i): remove * thread.c (debug_deadlock_check): implement (inlines check_deadlock_i) * thread.c (debug_i): remove * thread.c (rb_check_deadlock): iterate inline * vm.c (vm_mark_each_thread_func): remove * vm.c (rb_vm_mark): iterate inline * vm_core.h (rb_vm_living_threads_remove): remove * vm_trace.c (clear_trace_func_i): remove * vm_trace.c (rb_clear_trace_func): iterate inline git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26thread.c: inspect locationnobu
* thread.c (rb_thread_inspect): show the location of the block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26thread.c: preserve encodingnobu
* thread.c (rb_thread_inspect): preserve encoding of the class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-14* ext/openssl/depend: remove dependency from internal headers.ko1
[Feature #9612] * ext/openssl/ossl.c (ossl_fips_mode_set): ditto. * ext/coverage/depend: ditto. * include/ruby/thread_native.h: added. This header file only provides wrapper functions to control native threads. These wrapper functions are used by MRI implementation. * vm_core.h: use include/ruby/thread_native.h. * thread.c: ditto. * thread_pthread.h: ditto. * thread_win32.h: ditto. * thread_native.h: removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-10vm*: doubly-linked list from ccan to manage vm->living_threadsnormal
A doubly-linked list for tracking living threads guarantees constant-time insert/delete performance with no corner cases of a hash table. I chose this ccan implementation of doubly-linked lists over the BSD sys/queue.h implementation since: 1) insertion and removal are both branchless 2) locality is improved if a struct may be a member of multiple lists (0002 patch in Feature 9632 will introduce a secondary list for waiting FDs) This also increases cache locality during iteration: improving performance in a new IO#close benchmark with many sleeping threads while still scanning the same number of threads. vm_thread_close 1.762 * vm_core.h (rb_vm_t): list_head and counter for living_threads (rb_thread_t): vmlt_node for living_threads linkage (rb_vm_living_threads_init): new function wrapper (rb_vm_living_threads_insert): ditto (rb_vm_living_threads_remove): ditto * vm.c (rb_vm_living_threads_foreach): new function wrapper * thread.c (terminate_i, thread_start_func_2, thread_create_core, thread_fd_close_i, thread_fd_close): update to use new APIs * vm.c (vm_mark_each_thread_func, rb_vm_mark, ruby_vm_destruct, vm_memsize, vm_init2, Init_VM): ditto * vm_trace.c (clear_trace_func_i, rb_clear_trace_func): ditto * benchmark/bm_vm_thread_close.rb: added to show improvement * ccan/build_assert/build_assert.h: added as a dependency of list.h * ccan/check_type/check_type.h: ditto * ccan/container_of/container_of.h: ditto * ccan/licenses/BSD-MIT: ditto * ccan/licenses/CC0: ditto * ccan/str/str.h: ditto (stripped of unused macros) * ccan/list/list.h: ditto * common.mk: add CCAN_LIST_INCLUDES [ruby-core:61871][Feature 9632 (part 1)] Apologies for the size of this commit, but I think a good doubly-linked list will be useful for future features, too. This may be used to add ordering to a container_of-based hash table to preserve compatibility if required (e.g. feature 9614). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-10thread.c: always deliver signal immediatelynobu
* thread.c (ruby_kill): always deliver signal immediately, without check for main thread. no longer called in other context. [ruby-dev:48203] [Bug #9820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-10thread.c: stop if forked in a sub-threadnobu
* thread.c (thread_start_func_2): stop if forked in a sub-thread, the thread has become the main thread. [ruby-core:62070] [Bug #9751] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-26* parse.y: support Symbol GC. [ruby-trunk Feature #9634]nari
See this ticket about Symbol GC. * include/ruby/ruby.h: Declare few functions. * rb_sym2id: almost same as old SYM2ID but support dynamic symbols. * rb_id2sym: almost same as old ID2SYM but support dynamic symbols. * rb_sym2str: almost same as `rb_id2str(SYM2ID(sym))` but not pin down a dynamic symbol. Declare a new struct. * struct RSymbol: represents a dynamic symbol as object in Ruby's heaps. Add few macros. * STATIC_SYM_P: check a static symbol. * DYNAMIC_SYM_P: check a dynamic symbol. * RSYMBOL: cast to RSymbol * gc.c: declare RSymbol. support T_SYMBOL. * internal.h: Declare few functions. * rb_gc_free_dsymbol: free up a dynamic symbol. GC call this function at a sweep phase. * rb_str_dynamic_intern: convert a string to a dynamic symbol. * rb_check_id_without_pindown: not pinning function. * rb_sym2id_without_pindown: ditto. * rb_check_id_cstr_without_pindown: ditto. * string.c (Init_String): String#intern and String#to_sym use rb_str_dynamic_intern. * template/id.h.tmpl: use LSB of ID as a flag for determining a static symbol, so we shift left other ruby_id_types. * string.c: use rb_sym2str instead `rb_id2str(SYM2ID(sym))` to avoid pinning. * load.c: use xx_without_pindown function at creating temporary ID to avoid pinning. * object.c: ditto. * sprintf.c: ditto. * struct.c: ditto. * thread.c: ditto. * variable.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-27adjust indent and stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-26* thread.c: [DOC] Typo in comment for _FORTIFY_SOURCE [Fixes GH-548]zzak
Patch by @qnet-herwin https://github.com/ruby/ruby/pull/548 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14* include/ruby/intern.h,akr
include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [ruby-core:60581] [Feature #9502] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28vm_core.h: rb_thread_struct::machinenobu
* vm_core.h (rb_thread_struct): aggregate cpu stuff into a struct, so that a debugger can show its content at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13thread.c: reduce tags and stacknobu
* thread.c: (exec_recursive): use rb_catch_protect() instead of rb_catch_obj() and PUSH_TAG(), and reduce pushing tags and machine stack usage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-06thread.c: compare_by_idnobu
* thread.c (recursive_list_access): let symbol only hashes compare the elements by id. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLISTnobu
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration argument list of rb_block_call_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: add blockarg to rb_block_call_funcnobu
* include/ruby/ruby.h (rb_block_call_func): add blockarg. block function can take block argument, e.g., proc {|&blockarg| ...}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-16* thread_pthread.c (thread_create_core): Ditto.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09* thread.c: [DOC] Remove duplicate referencezzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-31* thread.c (rb_mutex_struct): reduce rb_mutex_t size by 8 byteskosaki
on 64bit platform. Patch by Eric Wong. [Feature #9068][ruby-core:58114] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko1
safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-24* thread.c (rb_thread_terminate_all): add a comment why we needkosaki
state check and call terminate_i again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-24* thread.c (rb_thread_terminate_all): add a comment why infinitekosaki
sleep is safe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22* vm_trace.c: exterminate Zombies.ko1
There is a bug that T_ZOMBIE objects are not collected. Because there is a pass to miss finalizer postponed job with multi-threading. This patch solve this issue. * vm_trace.c (rb_postponed_job_register_one): set RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) if another same job is registered. There is a possibility to remain a postponed job without interrupt flag. * vm_trace.c (rb_postponed_job_register_one): check interrupt carefully. * vm_trace.c (rb_postponed_job_register_one): use additional space to avoid buffer full. * gc.c (gc_finalize_deferred_register): check failure. * thread.c (rb_threadptr_execute_interrupts): check `postponed_job_interrupt' immediately. There is a possibility to miss this flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e