| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
instead of %s and RSTRING_PTR to protect objects from being garbage
collected too soon
* encoding.c (str_to_encindex): ditto
* hash.c (rb_hash_fetch_m): ditto
* io.c (rb_io_reopen): ditto
* parse.y (reg_fragment_check_gen): ditto
* parse.y (reg_compile_gen): ditto
* parse.y (ripper_assert_Qundef): ditto
* re.c (rb_reg_raise): ditto
* ruby.c (set_option_encoding_once): ditto
* vm_eval.c (rb_throw_obj): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when $SAFE is set to 4. $SAFE=4 is now obsolete.
[ruby-core:55222] [Feature #8468]
* object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust):
Kernel#untrusted?, untrust, and trust are now deprecated.
Their behavior is same as tainted?, taint, and untaint,
respectively.
* include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED()
and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(),
respectively.
* array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c,
ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c,
ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c,
ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c,
ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c,
ext/socket/socket.c, ext/socket/udpsocket.c,
ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c,
ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c,
load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c,
safe.c, string.c, thread.c, transcode.c, variable.c,
vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for
$SAFE=4.
* test/dl/test_dl2.rb, test/erb/test_erb.rb,
test/readline/test_readline.rb,
test/readline/test_readline_history.rb, test/ruby/test_alias.rb,
test/ruby/test_array.rb, test/ruby/test_dir.rb,
test/ruby/test_encoding.rb, test/ruby/test_env.rb,
test/ruby/test_eval.rb, test/ruby/test_exception.rb,
test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb,
test/ruby/test_io.rb, test/ruby/test_method.rb,
test/ruby/test_module.rb, test/ruby/test_object.rb,
test/ruby/test_pack.rb, test/ruby/test_rand.rb,
test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb,
test/ruby/test_struct.rb, test/ruby/test_thread.rb,
test/ruby/test_time.rb: remove tests for $SAFE=4.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* io.c (io_getc): fix 7bit coderange condition, check if ascii read
data instead of read length. [ruby-core:55444] [Bug #8516]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c,
load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c,
error.c, ruby.c: Remove the definitions of numberof.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
instead of using RARRAY_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
encoding is ASCII-8BIT. [Bug #8342]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
* io.c (rb_io_ext_int_to_encs, parse_mode_enc): bom-prefixed name is
not a real encoding name, just a fallback. so the proper conversion
should take place even if if the internal encoding is equal to the
bom-prefixed name, unless actual encoding is equal to the internal
encoding. [ruby-core:54563] [Bug #8323]
* io.c (io_set_encoding_by_bom): reset extenal encoding if no BOM
found. [ruby-core:54569]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
EAGAIN != EWOULDBLOCK.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* io.c (Init_IO): define EWOULDBLOCK alway as it is needed always.
and turn runtime branch into preprocessor condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
subclasses that include WaitReadable or WaitWritable rather than
extending them into the exception object each time.
* error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and
export them for use in WaitReadable/Writable exceptions.
* io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that
include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail
for nonblocking failures using those exceptions. Use that
function in io_getpartial and io_write_nonblock instead of
rb_mod_sys_fail
* ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include
WaitReadable and WaitWritable. Use those classes for
write_would_block and read_would_block instead of rb_mod_sys_fail.
* ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of
rb_mod_sys_fail in bsock_sendmsg_internal and
bsock_recvmsg_internal.
* ext/socket/init.c: Use rb_readwrite_sys_fail instead of
rb_mod_sys_fail in rsock_s_recvfrom_nonblock and
rsock_s_connect_nonblock.
* ext/socket/socket.c: Use rb_readwrite_sys_fail instead of
rb_mod_sys_fail in sock_connect_nonblock.
* include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead
of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and
RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
(interpret_seek_whence): New function.
[ruby-dev:45818] [Feature #6643]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* io.c (argf_next_argv): set init flag if succeeded to forward, after
skipping.
* io.c (argf_block_call_i, argf_block_call): no more forwarding if
forwarded after skipping. [ruby-list:49185]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* io.c (argf_close): deal with init flag.
* io.c (argf_block_call_i, argf_block_call): forward next file if
skipped while iteration, to get rid of IOError. [ruby-list:49185]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
Because musl libc doesn't have it. [Bug #8051] [ruby-core:53229]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
http://c5632.rubyci.org/~chkbuild/ruby-trunk/log/20130316T050302Z.diff.html.gz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* io.c (max_file_descriptor): rb_atomic_t for ATOMIC_CAS().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* io.c: here. because __syscall() is only used from io.c.
* include/ruby/missing.h: move "#include <sys/type.h>" to ....
* include/ruby/intern.h: here. because it was introduced for
fixing NFDBITS issue. [ruby-core:05179].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* file.c (rb_sys_fail_path_with_func): share same function, and path
may be nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
don't conflict. [Bug #5918] [ruby-core:42199]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
is used from timer thread too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* io.c (FOREACH_ARGF): loop for ARGF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* io.c (rb_io_getline_fast, rb_io_each_{byte,codepoint}): simplify
loops.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* io.c (pipe_open): envp is not used if only spawnv is defined right
now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* io.c (rb_cloexec_fcntl_dupfd) Use an emulation with dup(2) when
fcntl(2) and/or F_DUPFD is unavailable.
Suggested by akr.
* configure.in (HAVE_FCNTL): NativeClient does not provide fcntl(2).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* io.c (rb_maygvl_fd_fix_cloexec): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
bootstrap_test/test_io.rb. NativeClient does not support F_DUPFD
but supports dup2(2).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* error.c (compile_err_append, compile_warn_print, warn_print): use
rb_write_error_str() instead of writing to rb_stderr directly.
* io.c (rb_write_error_str): a stopgap measure not to unblock GVL.
warning from require seems to still have race condition errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* io.c (rb_io_lines, rb_io_bytes, rb_io_chars, rb_io_codepoints):
Deprecate IO#{lines,bytes,chars,codepoints} and those of ARGF.
[Feature #6670]
* ext/stringio/stringio.c (strio_lines, strio_bytes, strio_chars)
(strio_codepoints): Deprecate
StringIO#{lines,bytes,chars,codepoints}. [Feature #6670]
* ext/zlib/zlib.c (rb_gzreader_lines, rb_gzreader_bytes):
Deprecate Zlib::GzipReader#{lines,bytes}. [Feature #6670]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
of rb_thread_fd_writable().
* io.c (rb_io_wait_readable): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
because it is for waiting until io readable.
* io.c (rb_io_wait_writable): always use rb_thread_fd_writable()
instaed of bare rb_wait_for_single_fd(). we shouldn't ignore
return value.
* io.c (rb_io_wait_readable): ditto. always use rb_thread_wait_fd().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
rb_thread_call_without_gvl2 uses 0 internally.
* io.c (io_flush_buffer_async2): adapt the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
fptr->write_lock have.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* io.c (io_flush_buffer): don't hold mutex if already have.
Now recursive lock may occur when following scenario.
fptr_finalize -> finish_writeconv_sync -> finish_writeconv
-> io_fflush.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
io_flush_buffer_async.
* io.c (io_flush_buffer_async2): new helper function for
io_flush_buffer. It uses rb_thread_call_without_gvl2() instead
of rb_thread_io_blocking_region.
* io.c (io_flush_buffer_sync2): new helper function for
io_flush_buffer_async2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* io.c (rb_write_internal2): new function. it uses
rb_thread_call_without_gvl2() instaed of rb_thread_io_blocking_region().
* io.c (rb_binwrite_string): uses rb_write_internal2 instead of
rb_write_internal. [Bug #7134]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
likes rb_io_wait_readable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
when EINTR. EINTR mean signal interrupt was happen. We don't
need any wait.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
temporary async_interrupt_timing(Object => :defer)
* io.c (rb_f_p): use rb_uninterruptible.
* io.c (rb_f_p_internal): helper function for rb_f_p().
* io.c (struct rb_f_p_arg): new struct for rb_f_p_internal.
* test/ruby/test_thread.rb (test_async_interrupt_and_p): test for
the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* test/ruby/test_thread.rb (test_async_interrupt_and_io):
test for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
range.c: use prepared IDs.
A patch from charliesome (Charlie Somerville).
[Bug #7495]
* common.mk: add dependency to id.h.
* common.mk: replace ID_H_INCLUDES with id.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|