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

63735 Коммитов

Автор SHA1 Сообщение Дата
Sutou Kouhei e2dfc0c26b [ruby/fiddle] Add support for specifying types by name as String or Symbol
For example, :voidp equals to Fiddle::TYPE_VOID_P.

https://github.com/ruby/fiddle/commit/3b4de54899
2020-11-18 09:05:13 +09:00
Sutou Kouhei ae7b53546c [ruby/fiddle] Add TYPE_CONST_STRING and SIZEOF_CONST_STRING for "const char *"
Add rb_fiddle_ prefix to conversion functions.h to keep backward
compatibility but value_to_generic() isn't safe for TYPE_CONST_STRING
and not String src. Use rb_fiddle_value_to_generic() instead.

https://github.com/ruby/fiddle/commit/0ffcaa39e5
2020-11-18 09:05:13 +09:00
MSP-Greg 64926d5007 test/net/smtp - use TCPSocket when UNIXSocket unavailable 2020-11-18 08:13:10 +09:00
Junichi Ito 2ef3b979bd NEWS: Add --backtrace-limit option [ci skip] 2020-11-17 14:17:37 -08:00
Jeremy Evans 898aff954e Remove NEWS entry about taint deprecation warnings [ci skip]
JunichiIto on GitHub correctly pointed out this is no longer
accurate due to the change to not display deprecation warnings by
default.
2020-11-17 13:58:27 -08:00
git 0829f14704 * 2020-11-18 [ci skip] 2020-11-18 03:53:08 +09:00
Koichi Sasada 5e3259ea74 fix public interface
To make some kind of Ractor related extensions, some functions
should be exposed.

* include/ruby/thread_native.h
  * rb_native_mutex_*
  * rb_native_cond_*
* include/ruby/ractor.h
  * RB_OBJ_SHAREABLE_P(obj)
  * rb_ractor_shareable_p(obj)
  * rb_ractor_std*()
  * rb_cRactor

and rm ractor_pub.h
and rename srcdir/ractor.h to srcdir/ractor_core.h
    (to avoid conflict with include/ruby/ractor.h)
2020-11-18 03:52:41 +09:00
Hiroshi SHIBATA 0683912db8 Skip tests related TLS with Windows platform. 2020-11-17 18:05:15 +09:00
Hiroshi SHIBATA cada6d85d0
Import net-smtp-0.2.0 from https://github.com/ruby/net-smtp 2020-11-17 14:17:45 +09:00
Sergei Trofimovich fcc88da5eb configure.ac: fix for upcoming autoconf-2.70
The failure initially noticed on `autoconf-2.69d` (soon to become 2.70):

```
$ ./configure
./configure: line 8720: syntax error near unexpected token `fi'
./configure: line 8720: `fi'
```

Before the change generated `./configure ` snippet looked like:

```
    if ! $CC -E -xc - <<SRC >/dev/null
then :

	#if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
	#error premature clang
	#endif
SRC
	as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5
fi
```

Note the newline that breaks here-document syntax.

After the change the snippet does not use here-document.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2020-11-17 09:41:59 +09:00
Jean Boussier ef19fb111a Expose the rb_interned_str_* family of functions
Fixes [Feature #13381]
2020-11-17 09:39:25 +09:00
Alan Wu 68ffc8db08 Set allocator on class creation
Allocating an instance of a class uses the allocator for the class. When
the class has no allocator set, Ruby looks for it in the super class
(see rb_get_alloc_func()).

It's uncommon for classes created from Ruby code to ever have an
allocator set, so it's common during the allocation process to search
all the way to BasicObject from the class with which the allocation is
being performed. This makes creating instances of classes that have
long ancestry chains more expensive than creating instances of classes
have that shorter ancestry chains.

Setting the allocator at class creation time removes the need to perform
a search for the alloctor during allocation.

This is a breaking change for C-extensions that assume that classes
created from Ruby code have no allocator set. Libraries that setup a
class hierarchy in Ruby code and then set the allocator on some parent
class, for example, can experience breakage. This seems like an unusual
use case and hopefully it is rare or non-existent in practice.

Rails has many classes that have upwards of 60 elements in the ancestry
chain and benchmark shows a significant improvement for allocating with
a class that includes 64 modules.

```
pre: ruby 3.0.0dev (2020-11-12T14:39:27Z master 6325866421)
post: ruby 3.0.0dev (2020-11-12T20:15:30Z cut-allocator-lookup)

Comparison:
                  allocate_8_deep
                post:  10336985.6 i/s
                 pre:   8691873.1 i/s - 1.19x  slower

                 allocate_32_deep
                post:  10423181.2 i/s
                 pre:   6264879.1 i/s - 1.66x  slower

                 allocate_64_deep
                post:  10541851.2 i/s
                 pre:   4936321.5 i/s - 2.14x  slower

                allocate_128_deep
                post:  10451505.0 i/s
                 pre:   3031313.5 i/s - 3.45x  slower
```
2020-11-16 17:41:40 -05:00
Alan Wu ebb96fa880 Fix singleton class cloning
Before this commit, `clone` gave different results depending on whether the original object
had an attached singleton class or not.

Consider the following setup:
```
class Foo; end
Foo.singleton_class.define_method(:foo) {}

obj = Foo.new

obj.singleton_class if $call_singleton

clone = obj.clone
```

When `$call_singleton = false`, neither `obj.singleton_class.singleton_class` nor
`clone.singleton_class.singleton_class` own any methods.

However, when `$call_singleton = true`, `clone.singleton_class.singleton_class` would own a copy of
`foo` from `Foo.singleton_class`, even though `obj.singleton_class.singleton_class` does not.

The latter case is unexpected and results in a visibly different clone, depending on if the original object
had an attached class or not.

Co-authored-by: Ufuk Kayserilioglu <ufuk.kayserilioglu@shopify.com>
2020-11-16 17:41:17 -05:00
Koichi Sasada 084e7e31b2 remain enabled and line specified trace points
If two or more tracepoints enabled with the same target and with
different target lines, the only last line is activated.
This patch fixes this issue by remaining existing trace instructions.
[Bug #17302]
2020-11-17 07:33:38 +09:00
git 1271782f9d * 2020-11-17 [ci skip] 2020-11-17 02:38:31 +09:00
Tomás Coêlho 1ee8d4b0ac Fix typo on Proc docs 2020-11-16 12:38:10 -05:00
Nobuyoshi Nakada 0f37f384d4
[DOC] Fixed a typo [ci skip] 2020-11-16 22:14:59 +09:00
Yusuke Endoh 8985add9eb Update TypeProf to 0.5.2 2020-11-16 17:44:52 +09:00
Soutaro Matsumoto bcd29fed69 Update TypeProf to 0.5.1 2020-11-16 17:44:08 +09:00
Soutaro Matsumoto 57ab779a9c Update RBS to 0.17.0 2020-11-16 17:44:08 +09:00
Kazuhiro NISHIYAMA 0ba096df17
Fix a link [ci skip] 2020-11-16 11:01:21 +09:00
Kazuhiro NISHIYAMA ef82a0efa3
Fix links [ci skip] 2020-11-16 10:59:58 +09:00
Jeremy Evans f5bb9115a7 Use more specific warning for ambiguous slash
Fixes [Bug #17124]
2020-11-15 15:25:32 -08:00
git 45fd53e0a2 * 2020-11-16 [ci skip] 2020-11-16 07:45:16 +09:00
Marc-Andre Lafortune fd46ff9d42 NEWS: merge Range and Regexp being frozen [doc] 2020-11-15 17:44:48 -05:00
git cd50ff8082 * 2020-11-15 [ci skip] 2020-11-15 10:04:28 +09:00
Nobuyoshi Nakada 0433f5ae4d
Functions defined in headers should be static inline 2020-11-15 09:59:29 +09:00
Yusuke Endoh 311a66b7f5 Update TypeProf to 0.5.0 2020-11-14 19:22:38 +09:00
Alan Wu 7826210541 Use rb_attr_get() for hidden ivar
rb_ivar_get() can issue an uninitialized ivar warning. We never want to
issue warnings about hidden ivars as they are not actionable for users.
2020-11-13 11:46:08 -05:00
git 1bd98ee295 * 2020-11-14 [ci skip] 2020-11-14 00:06:43 +09:00
Jeremy Evans ce9beb9d20 Improve error message when subclassing non-Class
Fixes [Bug #14726]
2020-11-13 07:06:13 -08:00
Benoit Daloze 6d05967468 Update to ruby/spec@b0b7f53 2020-11-13 13:17:24 +01:00
Benoit Daloze acbe7aa197 Update to ruby/mspec@f8b0618 2020-11-13 13:17:22 +01:00
Hiroshi SHIBATA 69c5474e10
Fixup 957efa95cc 2020-11-13 13:19:38 +09:00
Hiroshi SHIBATA e70a1d9b7f
Revert https://github.com/ruby/webrick/pull/44
Because the test for this change was still broken.
2020-11-13 12:06:42 +09:00
git c046cc1d1c * 2020-11-13 [ci skip] 2020-11-13 11:38:58 +09:00
hisanori 37e5b367c1 [ruby/webrick] add mime type of extention .mjs
https://github.com/ruby/webrick/commit/45d68f9eba
2020-11-13 11:36:50 +09:00
Jeremy Evans 957efa95cc [ruby/webrick] Allow empty POST and PUT requests without content length
RFC 7230 section 3.3.3 allows for this.

Fixes #30

https://github.com/ruby/webrick/commit/069e9b1908
2020-11-13 11:35:10 +09:00
Yusuke Endoh 6325866421 spec/ruby/core/file/utime_spec.rb: XFS seems to have Year 2038 problem
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201112T123004Z.fail.html.gz
```
1)
File.utime allows Time instances in the far future to set mtime and
atime (but some filesystems limit it up to 2446-05-10) FAILED
Expected [559444, 2446].include? 2038
to be truthy but was false
/home/chkbuild/chkbuild/tmp/build/20201112T123004Z/ruby/spec/ruby/core/file/utime_spec.rb:80:in
`block (4 levels) in <top (required)>'
/home/chkbuild/chkbuild/tmp/build/20201112T123004Z/ruby/spec/ruby/core/file/utime_spec.rb:3:in
`<top (required)>'
```

```
$ touch foo
$ ./miniruby -e 'time = Time.at(1<<44); File.utime(time, time, "foo")'
$ ls -l foo
-rw-r--r--. 1 mame wheel 0 Jan 19  2038 foo
```
2020-11-12 23:39:27 +09:00
Akira Matsuda 028d52bb94 [ruby/date] Numeric already includes Comparable
https://github.com/ruby/date/commit/f6140df0ad
2020-11-12 21:35:17 +09:00
Nobuyoshi Nakada 33574d57f1 [ruby/date] Updated timezones from timeanddate.com
https://github.com/ruby/date/commit/f08175e34d
2020-11-12 21:35:06 +09:00
Nobuyoshi Nakada 81dece54d6 [ruby/date] Honor timezones from timeanddate.com
https://github.com/ruby/date/commit/d20380fc55
2020-11-12 21:34:54 +09:00
Nobuyoshi Nakada d65f1140b9 [ruby/date] Fixed the script file name to update zonetab.list
https://github.com/ruby/date/commit/3c002b1daa
2020-11-12 21:34:43 +09:00
NARUSE, Yui 0fdcb947e8 [ruby/date] [DOC] declate DateTime class is deprecated
https://github.com/ruby/date/commit/58ca6e6a3e
2020-11-12 21:34:31 +09:00
Hiroshi SHIBATA e8f8e63f0a
Backport cosmetic changes from upstream repo that is ruby/rdoc 2020-11-12 21:05:59 +09:00
Hiroshi SHIBATA ffc8cf12e2
Fixed typo 2020-11-12 21:05:33 +09:00
Nobuyoshi Nakada 0d52dce3a3
strip trailing spaces and adjusted indents [ci skip] 2020-11-12 19:27:20 +09:00
git 98de98fb70 * 2020-11-12 [ci skip] 2020-11-12 17:00:25 +09:00
Yusuke Endoh a237617a5b array.rb: Remove unnecessary phrase from rdoc
A fix to 54fb8fb62a
2020-11-12 16:59:59 +09:00
Yusuke Endoh a02ba60466 array.rb: show examples whether `Array#shuffle!` has side effect or not
Partially revert 54fb8fb62a
2020-11-12 16:59:59 +09:00