Граф коммитов

622 Коммитов

Автор SHA1 Сообщение Дата
nobu 35a76874db thread.c: thread_shield_get_mutex
* thread.c (thread_shield_get_mutex): explicitly check if
  destroyed already.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-01 04:47:53 +00:00
nobu 2dffc6bba3 thread.c: identity hash
* thread.c (rb_uninterruptible): use identity hash for masking.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-30 07:56:02 +00:00
nobu 56458959a8 thread.c: identical hash
* thread.c (rb_thread_s_handle_interrupt): make identical hash,
  to compare masking classes just by their IDs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-30 02:53:57 +00:00
ko1 0d775f2a3c * vm_core.h: separate rb_iseq_body into rb_iseq_constant_body and
rb_iseq_variable_body (rb_iseq_t::variable_body).
  rb_iseq_variable_body can be modified after compilation.
* compile.c: use rb_iseq_t::variable_body.
* iseq.c: ditto.
* thread.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-22 10:55:02 +00:00
nobu 47e0957e21 thread.c: return the error
* thread.c (rb_wait_for_single_fd): return the error when ppoll
  failed.  fix r51319.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-22 00:34:47 +00:00
ko1 e4198a73d4 * make rb_iseq_t T_IMEMO object (type is imemo_iseq).
All contents of previous rb_iseq_t is in rb_iseq_t::body.
  Remove rb_iseq_t::self because rb_iseq_t is an object.
  RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq.
  So RubyVM::ISeq.of(something) method returns different wrapper
  objects but they point the same T_IMEMO/iseq object.
  This patch is big, but most of difference is replacement of
  iseq->xxx to iseq->body->xxx.
  (previous) rb_iseq_t::compile_data is also located to
  rb_iseq_t::compile_data.
  It was moved from rb_iseq_body::compile_data.
  Now rb_iseq_t has empty two pointers.
  I will split rb_iseq_body data into static data and dynamic data.
* compile.c: rename some functions/macros.
  Now, we don't need to separate iseq and iseqval (only VALUE).
* eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
* ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
* gc.c: check T_IMEMO/iseq.
* internal.h: add imemo_type::imemo_iseq.
* iseq.c: define RubyVM::InstructionSequnce as T_OBJECT.
  Methods are implemented by functions named iseqw_....
* load.c (rb_load_internal0): rb_iseq_new_top() returns
  rb_iseq_t (T_IMEMO/iesq).
* method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
* vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
* vm_core.h (struct rb_iseq_body): remove padding for
  [Bug #10037][ruby-core:63721].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21 22:52:59 +00:00
nobu 0fceffce7e thread.c: refactor a loop
* thread.c (do_select): replace switch and goto with a loop to
  suppress maybe-uninitialized warnings by gcc6.
* thread.c (set_unblock_function, rb_wait_for_single_fd): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21 12:21:35 +00:00
nobu d8d9148506 thread.c: reuse tag
* thread.c (rb_thread_terminate_all): reuse the tag pushed before
  a loop, instead of pushing/popping same tag repeatedly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20 00:11:40 +00:00
nobu 747129ae53 thread.c: fix timeout limit
* thread.c (ppoll): fix the limit, timeout argument of poll(2) is
  an int but not a time_t.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-19 15:21:00 +00:00
nobu 22f75c300d thread.c: gather common statements
* thread.c (vm_check_ints_blocking): gather common statements at
  the end, and prefer LIKELY for Visual C optimization.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-18 12:29:21 +00:00
nobu ce7fdcf0f8 RUBY_VM_CHECK_INTS_BLOCKING: move to thread.c
* thread.c (RUBY_VM_CHECK_INTS_BLOCKING): move from vm_core.h for
  the static function rb_threadptr_pending_interrupt_empty_p.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17 07:28:36 +00:00
normal 3ee156c7a3 thread.c (rb_thread_alone): simplify
This function now also works in more places if ruby_current_thread
is unset.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17 01:42:18 +00:00
normal 4fd2443580 avoid redundant GET_THREAD() calls
This reduces binary size slightly on my 32-bit system:

   text    data     bss     dec     hex filename
2847705   12360   30632 2890697  2c1bc9 ruby.orig
2847641   12360   30632 2890633  2c1b89 ruby

* iseq.c (rb_iseq_compile_with_option): reuse result of previous
  GET_THREAD() call
* thread.c (thread_create_core): ditto
  (rb_mutex_trylock): ditto
  (rb_mutex_lock): ditto
* process.c (rb_waitpid): avoid multiple eval from RUBY_VM_CHECK_INTS
* thread.c (rb_thread_check_ints): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16 20:42:43 +00:00
normal 08f234445c thread.c (mutex_alloc): remove needless volatile
Allocation functions do not do anything non-obvious to the
compiler, so there's no reason for volatile here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16 20:26:32 +00:00
normal 5522e010e5 thread.c (thread_initialize): avoid RSTRING_PTR and NUMT2INT
Favor passing VALUE args as-is and using PRisVALUE in format strings
to prevent premature GC.  In this case, we are not fixing any real
bug because location path has other references, but this makes code
easier-to-review.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-15 18:11:05 +00:00
usa 122476479a * thread.c (rb_thread_safe_level): fix document. $SAFE=3 is obsolete.
[ci skip]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18 14:39:21 +00:00
kosaki 8ecd3b7114 * thread.c (thread_start_func_2): don't interrupt when last thread exit
unless main thread is already exited. Otherwise main thread could be
  wrongly interrupted when it uses rb_thread_call_without_gvl(). Patch
  by Takehiro Kubo. [Bug #11237][ruby-dev:49044][GH-898]
* test/-ext-/gvl/test_last_thread.rb: new test for the above fix.
* ext/-test-/gvl/call_without_gvl/call_without_gvl.c: new ext for the
  above test.
* ext/-test-/gvl/call_without_gvl/extconf.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 22:52:01 +00:00
nobu c6e9425c06 thread.c: indent
* thread.c (rb_thread_inspect): adjust indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13 12:28:57 +00:00
naruse e2a930c73a add Thread.name and Thread.name= docs Feature #11251 [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13 10:58:14 +00:00
naruse 92ca9f0696 darwin can't set anothre thread's name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13 08:49:10 +00:00
naruse 712a570f56 * vm_core.h (rb_thread_t): add th->name.
* vm.c (th_init): initialize th->name.

* thread.c (Init_Thread): add Thread.name and Thread.name=.

* thread.c (rb_thread_inspect): show thread's name if set.

* thread.c (rb_thread_getname): defined.

* thread.c (rb_thread_setname): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13 08:39:30 +00:00
ko1 57b817f4c5 * method.h: make rb_method_entry_t a VALUE.
Motivation and new data structure are described in [Bug #11203].
  This patch also solve the following issues.
  * [Bug #11200] Memory leak of method entries
  * [Bug #11046] __callee__ returns incorrect method name in orphan
                 proc
* test/ruby/test_method.rb: add a test for [Bug #11046].
* vm_core.h: remvoe rb_control_frame_t::me. me is located at value
  stack.
* vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes
  because method entries are simple VALUEs.
* method.h:  Now, all method entries has own independent method
  definititons. Strictly speaking, this change is not essential,
  but for future changes.
  * rb_method_entry_t::flag is move to rb_method_definition_t::flag.
  * rb_method_definition_t::alias_count is now
    rb_method_definition_t::alias_count_ptr, a pointer to the counter.
* vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to
  search the current method entry from value stack.
* vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable
  assertions.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02 04:20:30 +00:00
nobu c5e9beac25 thread.c: class name encoding
* thread.c (thread_s_new): preserve the encoding of the class name
  in an error message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16 08:29:21 +00:00
ko1 e2c5094698 * eval_intern.h (THROW_DATA_P): use RB_TYPE_P() instead of
BUILTIN_TYPE().
* thread.c (thread_join): use THROW_DATA_P().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10 18:53:28 +00:00
ko1 04e348e61a * thread.c (thread_join): Fixnum (except TAG_FATAL) and
NODE should not be reached here.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10 08:28:22 +00:00
hsbt 6271eea522 * thread.c: Mutex#owned? is no longer experimental since 2.1.0
[fix GH-839][ci skip] Patch by @takiy33

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-07 00:28:06 +00:00
nobu e6b0653406 thread.c: volatile inside EXEC_TAG
* thread.c (rb_thread_io_blocking_region): assigned variables
  inside EXEC_TAG() should be volatile.
* thread.c (rb_thread_s_handle_interrupt): ditto.
* thread.c (exec_recursive): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03 15:45:00 +00:00
normal 8341136f07 thread.c: micro-optimize thread create/join
* 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 17:06:40 +00:00
hsbt 9ab7b7ec82 * thread.c: Improve documentation for Thread#value
[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-28 12:32:31 +00:00
nobu 059ea6e4d8 hash.c: move Hash specific functions
* 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
2015-01-23 02:36:50 +00:00
nobu 401c8bb00b thread.c: fix dynamic symbol keys
* 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-29 02:18:20 +00:00
ko1 9c6eaad723 * hash.c (rb_hash_delete): return Qnil if there are no corresponding
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-24 02:53:37 +00:00
nobu 3600b5e6f7 thread.c: no allocation during GC
* 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-21 02:35:48 +00:00
nobu 8cbf4003db thread.c: use the same method name
* 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-10 00:38:43 +00:00
nobu 428791543b thread.c: get rid of invalid ID symbol
* 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-09 01:16:27 +00:00
normal f9e3213f01 thread.c (do_select): rename parameters to avoid shadowing
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-06 01:10:06 +00:00
nobu e580a631be use 0 for reserved
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-12-01 06:38:04 +00:00
ko1 9c6deac2d1 * vm_core.h: add rb_thread_t::local_storage_recursive_hash
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-27 01:56:38 +00:00
akr 2b9191e557 * internal.h: Gather declarations in non-header files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18 15:13:05 +00:00
nobu adfce27ee0 thread.c: fix for older gcc
* 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-10 14:31:37 +00:00
nobu 50b78ebb98 ruby/ruby.h: eliminate disabled function call
* 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-10 12:45:21 +00:00
normal 9bb7dfa247 normalize reference to Timeout::Error
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-10-07 20:00:09 +00:00
akr 1ea4976041 * thread_pthread.c (native_set_thread_name): New function to
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-21 05:14:47 +00:00
ko1 8c6c9c46d8 * vm.c (rb_vm_register_special_exception): make new function to
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-09-11 10:53:48 +00:00
nobu 00b040b8d5 thread.c, vm_method.c: avoid inadvertent pin-down
* 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-30 12:36:34 +00:00
nobu e1b064c576 thread.c: fix indent
* 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-30 12:36:27 +00:00
nobu fcf0801518 thread.c: use RUBY_VM_CHECK_INTS
* 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-20 00:13:15 +00:00
ko1 76a929a7fc * parse.y: change Symbol <-> ID relationship to avoid
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-07-09 06:14:41 +00:00
ko1 ddae6a05d7 * vm_trace.c: clear and restore recursive checking thread local data
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-13 08:50:11 +00:00
nobu dfd8c5d402 thread.c: fix for non-scalar pthread_t
* 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-11 08:38:09 +00:00