* ext/date/date_core.c (Init_date_core): moved methods which make
sense only for DateTime to that class, instead of defining
private methods in Date and making them public in DateTime.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/date/date_core.c (ComplexDateData): reordered to adjust
common part with SimpleDateData.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Apparently, a component of Rails implements a buffering .write
method which keeps the String buffer around and makes it unsafe
for us to clear it after calling .write.
This caused Rack::Deflater to give empty results when enabled.
Fortunately, per r61631 / a55abcc0ca,
this misguided optimization was only worth a small (0.5MB) savings
and we still benefit from the majority of the memory savings in
that change.
Thanks to zunda for the bug report.
[ruby-core:90133] [Bug #15356]
Fixes: r61631 (commit a55abcc0ca)
("zlib: reduce garbage on gzip writes (deflate)")
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Cygwin/mingw linker should be able to link against shared library
itself. Mswin build sets -def:$(DEFFILE) option by the default.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
There seems to be a compatibility problems with Rails +
Rack::Deflater; so we revert this incompatibility.
This effectively reverts r65922; but keeps the bugfixes to
better support non-blocking sockets and pipes for future use.
[Bug #15356] [Bug #14968]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Perhaps this fixes test failures reported by Greg and k0kubun.
However, the failure of certain tests to handle non-blocking I/O
seems to indicate pre-existing problems on win32 platforms.
Somebody knowledgeable about win32 should be able to fix it.
[ruby-core:89973] [ruby-core:89976] [ruby-core:89977] [Bug #14968]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We need to make sockets non-blocking for systems without
SOCK_CLOEXEC/SOCK_NONBLOCK macros at all.
[ruby-core:89965] [Bug #14968]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
All normal Ruby IO methods (IO#read, IO#gets, IO#write, ...) are
all capable of appearing to be "blocking" when presented with a
file description with the O_NONBLOCK flag set; so there is
little risk of incompatibility within Ruby-using programs.
The biggest compatibility risk is when spawning external
programs. As a result, stdin, stdout, and stderr are now always
made blocking before exec-family calls.
This change will make an event-oriented MJIT usable if it is
waiting on pipes on POSIX_like platforms.
It is ALSO necessary to take advantage of (proposed lightweight
concurrency (aka "auto-Fiber") or any similar proposal for
network concurrency: https://bugs.ruby-lang.org/issues/13618
Named-pipe (FIFO) are NOT yet non-blocking by default since
they are rarely-used and may introduce compatibility problems
and extra syscall overhead for a common path.
Please revert this commit if there are problems and if I am afk
since I am afk a lot, lately.
[ruby-core:89950] [Bug #14968]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
_REENTRANT, _THREAD_SAFE, etc., which affect how errno is defined
on some architectures
* ext/openssl/ossl.h: include errno.h after ruby.h
* include/ruby/io.h: include errno.h after ruby/config.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/date/date_core.c (date_initialize): separate from
date_s_civil and obey the allocation framework.
* ext/date/date_core.c (datetime_initialize): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/date/date_core.c (d_lite_marshal_load): respect COMPLEX_DAT
bit in the pre-allocated structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/date/date_core.c (d_lite_initialize_copy): do not change
COMPLEX_DAT bit, as the structure does not change. initialize
member-wise instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/date/date_core.c (set_to_simple, set_to_complex): always
set/reset COMPLEX_DAT bit, which is very tightly bound to the
structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This becomes necesary if sockets become non-blocking by
default <https://bugs.ruby-lang.org/issues/14968>; but it's
always been possible to make sockets non-blocking anyways.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c, internal.h: support theap for small Hash.
Introduce RHASH_ARRAY (li_table) besides st_table and small Hash
(<=8 entries) are managed by an array data structure.
This array data can be managed by theap.
If st_table is needed, then converting array data to st_table data.
For st_table using code, we prepare "stlike" APIs which accepts hash value
and are very similar to st_ APIs.
This work is based on the GSoC achievement
by tacinight <tacingiht@gmail.com> and refined by ko1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/etc/extconf.rb: It supports to generate dependency header
on standalone gem with github repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: It supports to build libffi with standalone gem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This patch introduces "oneshot_lines" mode for `Coverage.start`, which
checks "whether each line was executed at least once or not", instead of
"how many times each line was executed". A hook for each line is fired
at most once, and after it is fired, the hook flag was removed; it runs
with zero overhead.
See [Feature #15022] in detail.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added deprecated warnings for the new interface of keyword argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e