kosaki
469cc48542
decrease fiber stack size. 1MB is too large for windows. [Bug #6344 ]
...
[ruby-dev:45554]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 09:10:46 +00:00
kosaki
5c56769118
* cont.c: bump up fiber machine stack size when running on 64bit
...
arch. [Bug #6344 ] [ruby-dev:45554]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 08:32:56 +00:00
ayumin
fd7632ee8e
* cont.c (rb_fiber_m_transfer): fixed typo in example.
...
[ruby-core:44818][Bug #6395 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-03 00:14:10 +00:00
nagachika
f0feb0a4f0
* cont.c (rb_fiber_m_transfer): improve sample code in Fiber#transfer
...
documentation. emphasize the difference between transfer and resume.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-02 14:30:48 +00:00
ayumin
6f72a6dcb5
* cont.c: Improved Fiber documentation.[ruby-core:44540][Bug #6343 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-02 10:13:28 +00:00
nobu
485f88e62e
* reduce UNREACHABLE.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 04:55:10 +00:00
drbrain
da39d32f60
* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
...
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066 ]
* re.c (name_to_backref_number): ditto.
* object.c (rb_Float): ditto.
* io.c (io_readpartial): ditto.
* io.c (io_read_nonblock): ditto.
* pack.c (rb_uv_to_utf8): ditto.
* proc.c (rb_method_entry_arity): ditto.
* vm_method.c (rb_f_notimplement): ditto.
* struct.c (rb_struct_aset_id): ditto.
* class.c (rb_scan_args): ditto.
* process.c (rlimit_resource_type): ditto.
* process.c (rlimit_resource_value): ditto.
* process.c (p_uid_switch): ditto.
* process.c (p_gid_switch): ditto.
* ext/digest/digest.c (rb_digest_instance_update): ditto.
* ext/digest/digest.c (rb_digest_instance_finish): ditto.
* ext/digest/digest.c (rb_digest_instance_reset): ditto.
* ext/digest/digest.c (rb_digest_instance_block_length): ditto.
* ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto.
* ext/dl/handle.c (rb_dlhandle_close): ditto.
* ext/tk/tcltklib.c (pending_exception_check0): ditto.
* ext/tk/tcltklib.c (pending_exception_check1): ditto.
* ext/tk/tcltklib.c (ip_cancel_eval_core): ditto.
* ext/tk/tcltklib.c (lib_get_reltype_name): ditto.
* ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto.
* ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto.
* ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto.
* ext/fiddle/conversions.c (generic_to_value): ditto.
* ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto.
* ext/socket/socket.c (sock_s_getnameinfo): ditto.
* ext/ripper/eventids2.c (ripper_token2eventid): ditto.
* cont.c (return_fiber): ditto.
* dmydln.c (dln_load): ditto.
* vm_insnhelper.c (vm_search_normal_superclass): ditto.
* bignum.c (big_fdiv): ditto.
* marshal.c (r_symlink): ditto.
* marshal.c (r_symbol): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13 23:45:37 +00:00
nagachika
2910f6736e
* cont.c (rb_fiber_reset_root_local_storage): add a new function to
...
restore rb_thread_t::local_storage.
* cont.c (rb_obj_is_fiber): add a new function to tell finalizer to
prevent fibers from destroy.
* gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing
objspace.
* internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber):
add prototypes.
* vm.c (ruby_vm_destruct): reset main thread's local_storage before
free main thread. rb_thread_t::local_storage is replaced by fiber's
local storage when forked from fiber, and it should be already freed
when the fiber was destroyed.
* test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork
from fiber.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 14:00:11 +00:00
naruse
ca22731439
* cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for
...
reserving a memory space with ALLOCA_N for restoring machine stack
stored in cont->machine_stack, but clang optimized out it (and
maybe #5851 is also caused by this).
This affected TestContinuation#test_check_localvars.
* cont.c (cont_restore_1): revert workaround introduced in r32201.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-12 05:12:03 +00:00
nobu
b526738c3b
* bignum.c (big_rshift), compile.c (validate_label,
...
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c
(dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open)
(rb_io_advise), parse.y (parser_compile_string)
(rb_parser_compile_file), proc.c (binding_free), process.c
(rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core)
(p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null),
signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main),
vm_insnhelper.c (vm_expandarray): suppress
unused-but-set-variable warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05 09:57:00 +00:00
naruse
81bedc68ac
* cont.c (fiber_switch): ignore fiber context switch
...
because destination fiber is same as current fiber.
With out this, it may segv on FreeBSD 9.
patched by Koichi Sasada.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20 21:17:57 +00:00
ko1
9cd8b76e6d
* cont.c (rb_fiber_m_transfer, rb_fiber_resume): prohibit using
...
"resume" after "transfer" method are used. You should not mix
"resume" fiber and "transfer" fiber.
[Bug #5526 ]
* NEWS: add information about this change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09 04:26:39 +00:00
akr
b317a4cd28
* io.c: use "__sun" instead of "sun" to detect SunOS.
...
* dln.c: ditto.
* cont.c: ditto.
* ext/sdbm/_sdbm.c: ditto.
[ruby-dev:44693]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24 13:49:58 +00:00
nobu
4f731db7b7
* cont.c (fiber_store): balance braces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-13 21:16:46 +00:00
nagachika
257d0ac80c
* cont.c (cont_mark): mark original Thread object from saved_thread.
...
[ruby-dev:44567] [Bug #5386 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-05 16:47:33 +00:00
ktsj
3e6a5b27f0
* vm.c (rb_thread_mark), cont.c (cont_mark): revert r33369 and r33371
...
that may cause SEGV in certain environments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-02 12:08:40 +00:00
ktsj
bc07265ceb
* vm.c (rb_thread_mark), cont.c (cont_mark): self pointer should not
...
be marked by itself. Patch by Koichi Sasada.
[ruby-dev:44567] [Bug #5386 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-01 23:48:48 +00:00
kosaki
3ffa44622d
* cont.c (fiber_entry): fix stack allocation failure on Debian
...
GNU/kFreeBSD.
Patch by Lucas Nussbaum <lucas at lucas-nussbaum dot net>.
[Bug #5241 ] [ruby-core:39147]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:51:46 +00:00
naruse
f9260247d2
* cont.c (HAVE_GETCONTEXT): see getcontext(3) because DragonFly BSD
...
x64 port doesn't have it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-06 22:18:45 +00:00
takano32
8ea395f546
* cont.c (cont_save_thread): fix missing semicolon.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-19 07:39:54 +00:00
kosaki
4ad2d02a49
* cont.c (FIBER_MACHINE_STACK_ALLOCATION_SIZE): Fiber stack size
...
don't need to keep multiple number of sizeof(VALUE).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 04:09:00 +00:00
kosaki
68a0d412dd
add a comment why FreeBSD can't use MAP_STACK.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-07 09:09:44 +00:00
naruse
a259db72b7
* cont.c (FIBER_STACK_FLAGS): workaround fix for r32420 on FreeBSD.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-06 21:57:16 +00:00
kosaki
0242fe816c
* cont.c (fiber_machine_stack_alloc): cleanup pointer arithmetic.
...
"size/sizeof(VALUE)" is ugly and easy confusing.
* cont.c (fiber_initialize_machine_stack_context): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-06 12:31:53 +00:00
kosaki
032e56fbd6
* cont.c (fiber_machine_stack_alloc): fix mprotect misuse. A stack
...
guard page should have PROT_NONE.
* cont.c (fiber_initialize_machine_stack_context):
th->machine_stack_maxsize shouldn't be included guard pages size.
[Bug #4983 ][ruby-dev:44043]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-06 12:29:09 +00:00
kosaki
c454ee6c9f
* cont.c (fiber_machine_stack_alloc): use MAP_STACK if it's provided.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-06 12:24:25 +00:00
kosaki
302fcb568d
* cont.c (fiber_machine_stack_alloc): use MAP_FAILED instead of -1.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-06 12:22:56 +00:00
kosaki
a737fc8ace
* cont.c (fiber_machine_stack_alloc): remove unnecessary cast.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-06 12:21:50 +00:00
mame
d6a5698d8a
* cont.c: disable FIBER_USE_NATIVE on Solaris because resuming any
...
Fiber caused SEGV. I haven't follow up the issue deeply, but it
works when disabling the feature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-04 16:32:12 +00:00
naruse
be953b4d1c
* cont.c (cont_capture): add volatile.
...
On clang -O, it is needed to avoid the optimization.
With this and llvm/clang's recent fix, clang 3.0 can
build ruby-trunk with -O option.
* cont.c (cont_capture): use for-loop.
* array.c (rb_ary_each): add volatile and use it.
* vm_insnhelper.c (vm_call_cfunc): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-22 11:00:24 +00:00
akr
e7996eb3cc
* internal.h: declare internal functions here.
...
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17 22:43:38 +00:00
nobu
0d5ed3d2ad
* suppress compile warnings.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17 22:33:59 +00:00
nobu
685444569c
* fix for build on solaris 10.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 00:12:55 +00:00
nagachika
3ec2b843c8
* cont.c (cont_save_thread): add new utility function.
...
rb_context_t::saved_thread.machine_stack_start and
machine_stack_end should be cleared immediately after a snapshot of
current thread is stored to saved_thread.
this change aims to get rid of unnecessary GC mark at machine stack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-14 12:57:50 +00:00
nagachika
6d9e64d37c
* cont.c (root_fiber_alloc): set root fiber's status RUNNING.
...
in cont_mark() only RUNNING fiber's machine stack is marked.
root fiber's status should be RUNNING at the beginning regardless of
FIBER_USE_NATIVE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-08 12:50:03 +00:00
nagachika
4d85a0df20
* cont.c: use #if FIBER_USE_NATIVE instead of #ifdef.
...
you can suppress use of setcontext for Fiber with compile option
-DFIBER_USE_NATIVE=0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-06 14:06:59 +00:00
nagachika
980155686a
* cont.c (cont_init): clear macihne_stack_start/end of saved thread to
...
prevent mark machine stack of GC'ed Thread. root Fiber is not initialized by
fiber_init(). based on a patch by Serge Balyuk [ruby-core:35891] fixes #4612
* test/ruby/test_fiber.rb (test_gc_root_fiber): add test for it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 12:41:40 +00:00
akr
75877a30a4
* cont.c: parenthesize macro arguments.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-06 20:56:04 +00:00
mame
d433ec574a
* cont.c (fiber_t_alloc): raise an error when fiber is going to be
...
initialized twice. [ruby-dev:42524]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-03 17:08:35 +00:00
mame
a9afb7e5c6
* cont.c (rb_fiber_resume): raise an "double resume" error when root
...
fiber is going to be resumed. [ruby-dev:42523]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-03 17:08:25 +00:00
naruse
bb2dc7e986
* cont.c: apply documentation patch by Run Paint Run Run.
...
[ruby-core:32915]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-27 00:26:29 +00:00
nobu
4fe1e7c69b
* cont.c (fiber_setcontext): missing variable definition.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12 13:18:21 +00:00
naruse
eaa4e02d45
* cont.c (fiber_memsize): Return size.
...
Before this change, fiber_memsize always returns 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-03 23:00:21 +00:00
usa
e53a60147b
* cont.c: typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-28 00:38:21 +00:00
naruse
392ab9d05e
* cont.c: (RB_PAGE_SIZE): renamed from PAGE_SIZE. [ruby-dev:41870]
...
* cont.c: (RB_PAGE_MASK): renamed from PAGE_MASK.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-28 00:25:53 +00:00
naruse
7175a9073e
* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:
...
clean unused-value warnings.
* cont.c, process.c, vm_exec.h: clean cast warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27 07:13:43 +00:00
nobu
0bd71ff354
* configure.in (XCFLAGS): use -fvisibility=hidden if possible.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-21 21:38:25 +00:00
nobu
25b9eb5e57
* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]
...
add parent member.
* error.c (rb_typeddata_inherited_p): new function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18 07:31:54 +00:00
kosaki
51ba9a6b14
* cont.c (fiber_setcontext): Use swapcontext() instead longjmp().
...
[ruby-dev:41316] [Bug #3295 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21 18:55:50 +00:00
marcandre
7729de4d91
* array.c: Documentation: change => in call-seq to ->.
...
Harmonize "#=>" in examples. [ruby-core:30206]
* bignum.c: ditto
* class.c: ditto
* compar.c: ditto
* cont.c: ditto
* dir.c: ditto
* encoding.c: ditto
* enum.c: ditto
* enumerator.c: ditto
* error.c: ditto
* eval.c: ditto
* file.c: ditto
* gc.c: ditto
* io.c: ditto
* load.c: ditto
* marshal.c: ditto
* math.c: ditto
* numeric.c: ditto
* object.c: ditto
* pack.c: ditto
* proc.c: ditto
* process.c: ditto
* random.c: ditto
* range.c: ditto
* re.c: ditto
* ruby.c: ditto
* signal.c: ditto
* sprintf.c: ditto
* string.c: ditto
* struct.c: ditto
* thread.c: ditto
* time.c: ditto
* transcode.c: ditto
* variable.c: ditto
* vm_eval.c: ditto
* vm_method.c: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:07:33 +00:00