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

63709 Коммитов

Автор SHA1 Сообщение Дата
git 80d3f21994 * 2020-11-20 [ci skip] 2020-11-20 09:25:12 +09:00
Kevin Murphy 0026f644d7 Document Different Coverage Modes
This commits adds in documentation to illustrate the different modes you
can start coverage with. Examples are provided to show how to start each
of these modes, along with an explanation of the mode and a description
of the output.
2020-11-20 09:24:46 +09:00
Nobuyoshi Nakada 44ad72fa21
Added assertions 2020-11-19 15:41:53 +09:00
Hiroshi SHIBATA 9c1e2a99fc
Update the default gems section in NEWS.md 2020-11-19 15:36:21 +09:00
Jeremy Evans 4a5c42db88 Make RubyVM::InstructionSequence.compile_file use same encoding as load
This switches the internal function from rb_parser_compile_file_path
to rb_parser_load_file, which is the same internal method that
Kernel#load uses.

Fixes [Bug #17308]
2020-11-19 07:12:50 +09:00
git fee0073726 * 2020-11-19 [ci skip] 2020-11-19 07:11:57 +09:00
Cristian Greco ce3c9a3437 Fix USE_TRANSIENT_HEAP macro usage in hash.c
Additionally fix some typos in transient heap.
2020-11-19 07:11:36 +09:00
Hiroshi SHIBATA dc3a65bd99
[ruby/net-smtp] Bump version to 0.2.1
https://github.com/ruby/net-smtp/commit/6e5c09dcc4
2020-11-18 16:28:46 +09:00
Yusuke Endoh 6e487719b4 Update TypeProf to 0.6.1 2020-11-18 16:27:41 +09:00
Jeremy Evans 1301bd8ca9 Update documentation for Ripper.{lex,tokenize,sexp,sexp_raw} [ci skip] 2020-11-17 21:26:56 -08:00
Jeremy Evans cd0877a93e
Support raise_errors keyword for Ripper.{lex,tokenize,sexp,sexp_raw}
Implements [Feature #17276]
2020-11-17 21:15:50 -08:00
Kazuhiro NISHIYAMA a776032ef1
Move the declaration into the function
instead of 'do not call it directly.' comment.
2020-11-18 10:52:56 +09:00
Sutou Kouhei 519062b350 Add Fiddle 1.0.2 to NEWS 2020-11-18 09:05:13 +09:00
Sutou Kouhei 0915a02068 Update Fiddle's dependencies 2020-11-18 09:05:13 +09:00
Sutou Kouhei fcd680fbf0 [ruby/fiddle] Remove needless return
https://github.com/ruby/fiddle/commit/50e02f9445
2020-11-18 09:05:13 +09:00
Sutou Kouhei aa22b6658a [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/74b65cb858
2020-11-18 09:05:13 +09:00
Sutou Kouhei 5c7ef89db4 [ruby/fiddle] test: suppress shadowing outer local variable warning
https://github.com/ruby/fiddle/commit/cf168680a2
2020-11-18 09:05:13 +09:00
Sutou Kouhei ceccc16589 [ruby/fiddle] Remove needless workaround
It's fixed in upstream.
https://github.com/MSP-Greg/ruby-loco/issues/4

https://github.com/ruby/fiddle/commit/2ae0ff4934
2020-11-18 09:05:13 +09:00
Sutou Kouhei 3b385c33b8 [ruby/fiddle] Add workaround for ruby head for mingw
https://github.com/ruby/fiddle/commit/bb227c206d
2020-11-18 09:05:13 +09:00
Sutou Kouhei 821cfa74cb [ruby/fiddle] Use msys2_mingw_dependencies
https://github.com/ruby/fiddle/commit/fee175a8ff
2020-11-18 09:05:13 +09:00
Sutou Kouhei e27701291a [ruby/fiddle] Use ruby_xcalloc() instead of ruby_xmalloc() and memset()
https://github.com/ruby/fiddle/commit/6d24fb5438
2020-11-18 09:05:13 +09:00
Sutou Kouhei 1867088d90 [ruby/fiddle] Remove needless rescue
GitHub: fix GH-15

Reported by Eneroth3. Thanks!!!

https://github.com/ruby/fiddle/commit/f3d70b81ec
2020-11-18 09:05:13 +09:00
Sutou Kouhei aff5eaced4 [ruby/fiddle] Add workaround for RubyInstaller for Windows
See comment for details.

https://github.com/ruby/fiddle/commit/0c76f03dc4
2020-11-18 09:05:13 +09:00
Aaron Patterson 307388ea19 [ruby/fiddle] Add a "pinning" reference (#44)
* Add a "pinning" reference

A `Fiddle::Pinned` objects will prevent the objects they point to from
moving.  This is useful in the case where you need to pass a reference
to a C extension that keeps the address in a global and needs the
address to be stable.

For example:

```ruby
class Foo
  A = "hi" # this is an embedded string

  some_c_function A # A might move!
end
```

If `A` moves, then the underlying string buffer may also move.
`Fiddle::Pinned` will prevent the object from moving:

```ruby
class Foo
  A = "hi" # this is an embedded string

  A_pinner = Fiddle::Pinned.new(A) # :nodoc:

  some_c_function A # A can't move because of `Fiddle::Pinned`
end
```

This is a similar strategy to what Graal uses:

  https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/PinnedObject.html#getObject--

* rename global to match exception name

* Introduce generic Fiddle::Error and rearrange error classes

Fiddle::Error is the generic exception base class for Fiddle exceptions.
This commit introduces the class and rearranges Fiddle exceptions to
inherit from it.

https://github.com/ruby/fiddle/commit/ac52d00223
2020-11-18 09:05:13 +09:00
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