aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
Commit message (Collapse)AuthorAgeFilesLines
...
* decrease fiber stack size. 1MB is too large for windows. [Bug #6344]kosaki2012-05-181-1/+1
| | | | | | [ruby-dev:45554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c: bump up fiber machine stack size when running on 64bitkosaki2012-05-181-2/+7
| | | | | | arch. [Bug #6344] [ruby-dev:45554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_m_transfer): fixed typo in example.ayumin2012-05-031-3/+3
| | | | | | [ruby-core:44818][Bug #6395] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_m_transfer): improve sample code in Fiber#transfernagachika2012-05-021-0/+1
| | | | | | 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
* * cont.c: Improved Fiber documentation.[ruby-core:44540][Bug #6343]ayumin2012-05-021-0/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * reduce UNREACHABLE.nobu2012-04-171-9/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain2012-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * cont.c (rb_fiber_reset_root_local_storage): add a new function tonagachika2012-02-151-0/+24
| | | | | | | | | | | | | | | | | | | | | | | 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
* * cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used fornaruse2012-01-121-5/+4
| | | | | | | | | | | 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
* * bignum.c (big_rshift), compile.c (validate_label,nobu2011-12-051-1/+1
| | | | | | | | | | | | | | 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
* * cont.c (fiber_switch): ignore fiber context switchnaruse2011-11-201-0/+7
| | | | | | | | 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
* * cont.c (rb_fiber_m_transfer, rb_fiber_resume): prohibit usingko12011-11-091-2/+14
| | | | | | | | | | | "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
* * io.c: use "__sun" instead of "sun" to detect SunOS.akr2011-10-241-1/+1
| | | | | | | | | | | | | | * 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
* * cont.c (fiber_store): balance braces.nobu2011-10-131-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (cont_mark): mark original Thread object from saved_thread.nagachika2011-10-051-0/+1
| | | | | | [ruby-dev:44567] [Bug #5386] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_thread_mark), cont.c (cont_mark): revert r33369 and r33371ktsj2011-10-021-1/+1
| | | | | | that may cause SEGV in certain environments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_thread_mark), cont.c (cont_mark): self pointer should notktsj2011-10-011-1/+1
| | | | | | | 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
* * cont.c (fiber_entry): fix stack allocation failure on Debiankosaki2011-08-301-1/+2
| | | | | | | | | 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
* * cont.c (HAVE_GETCONTEXT): see getcontext(3) because DragonFly BSDnaruse2011-08-061-1/+1
| | | | | | x64 port doesn't have it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (cont_save_thread): fix missing semicolon.takano322011-07-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (FIBER_MACHINE_STACK_ALLOCATION_SIZE): Fiber stack sizekosaki2011-07-081-2/+2
| | | | | | | | 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
* add a comment why FreeBSD can't use MAP_STACK.kosaki2011-07-071-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (FIBER_STACK_FLAGS): workaround fix for r32420 on FreeBSD.naruse2011-07-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (fiber_machine_stack_alloc): cleanup pointer arithmetic.kosaki2011-07-061-6/+6
| | | | | | | | | "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
* * cont.c (fiber_machine_stack_alloc): fix mprotect misuse. A stackkosaki2011-07-061-3/+6
| | | | | | | | | | | 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
* * cont.c (fiber_machine_stack_alloc): use MAP_STACK if it's provided.kosaki2011-07-061-1/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (fiber_machine_stack_alloc): use MAP_FAILED instead of -1.kosaki2011-07-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (fiber_machine_stack_alloc): remove unnecessary cast.kosaki2011-07-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c: disable FIBER_USE_NATIVE on Solaris because resuming anymame2011-07-041-1/+1
| | | | | | | 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
* * cont.c (cont_capture): add volatile.naruse2011-06-221-3/+4
| | | | | | | | | | | | | | 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
* * internal.h: declare internal functions here.akr2011-06-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * suppress compile warnings.nobu2011-06-171-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * fix for build on solaris 10.nobu2011-06-161-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (cont_save_thread): add new utility function.nagachika2011-06-141-11/+17
| | | | | | | | | 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
* * cont.c (root_fiber_alloc): set root fiber's status RUNNING.nagachika2011-06-081-1/+1
| | | | | | | | 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
* * cont.c: use #if FIBER_USE_NATIVE instead of #ifdef.nagachika2011-06-061-14/+15
| | | | | | | 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
* * cont.c (cont_init): clear macihne_stack_start/end of saved thread tonagachika2011-05-151-0/+1
| | | | | | | | 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
* * cont.c: parenthesize macro arguments.akr2010-12-061-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (fiber_t_alloc): raise an error when fiber is going to bemame2010-11-031-0/+4
| | | | | | initialized twice. [ruby-dev:42524] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_resume): raise an "double resume" error when rootmame2010-11-031-1/+1
| | | | | | 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
* * cont.c: apply documentation patch by Run Paint Run Run.naruse2010-10-271-21/+28
| | | | | | [ruby-core:32915] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (fiber_setcontext): missing variable definition.nobu2010-10-121-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (fiber_memsize): Return size.naruse2010-10-031-1/+1
| | | | | | 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
* * cont.c: typos.usa2010-07-281-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c: (RB_PAGE_SIZE): renamed from PAGE_SIZE. [ruby-dev:41870]naruse2010-07-281-6/+6
| | | | | | * 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
* * class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse2010-07-271-1/+1
| | | | | | | | 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
* * configure.in (XCFLAGS): use -fvisibility=hidden if possible.nobu2010-07-211-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-2/+2
| | | | | | | | 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
* * cont.c (fiber_setcontext): Use swapcontext() instead longjmp().kosaki2010-05-211-10/+1
| | | | | | | | [ruby-dev:41316] [Bug #3295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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