Commit graph

63661 commits

Author SHA1 Message Date
git
dfefe0e0d0 * 2020-09-06 [ci skip] 2020-09-06 01:59:20 +09:00
Kazuhiro NISHIYAMA
776b3df490
Fix typos [ci skip] 2020-09-06 01:58:44 +09:00
Nobuyoshi Nakada
170c7528e6
common.mk: UNALIGNED_MEMBER_ACCESS needs internal/warnings.h on some platforms 2020-09-05 23:16:26 +09:00
Nobuyoshi Nakada
dd83d0c599
update-deps: ruby-runner is not a target 2020-09-05 23:16:23 +09:00
Nobuyoshi Nakada
5c49bb5486
Removed useless casts 2020-09-05 17:34:12 +09:00
andrewmelis
72757fb596 Fix typo in ractor.md 2020-09-05 17:21:43 +09:00
Tom Schady
de30450d91 Fix typos in Ractor README. 2020-09-04 12:41:35 -04:00
git
1c8fe90760 * 2020-09-05 [ci skip] 2020-09-05 00:42:35 +09:00
Nobuyoshi Nakada
f943566d1c
break around function definition [ci skip] 2020-09-05 00:34:58 +09:00
Nobuyoshi Nakada
1c78f5d5b8
Sort links in NEWS.md by URI [ci skip] 2020-09-04 22:20:46 +09:00
Nobuyoshi Nakada
eb67c603ca
Added Symbol#name
https://bugs.ruby-lang.org/issues/16150#change-87446
2020-09-04 22:18:59 +09:00
Nobuyoshi Nakada
d7406ccc2c
Updated dependency 2020-09-04 16:28:40 +09:00
Nobuyoshi Nakada
d164eef957
Fixed heap-use-after-free on racter 2020-09-04 15:17:42 +09:00
Marc-Andre Lafortune
fbaab562d9 lib/ostruct.rb: Revert "To use RuntimeError instead of FrozenError for old ruby versions."
This reverts commit 4cd1fc8b3559353069860eee90b1b5bade013917.
2020-09-04 01:23:14 -04:00
Koichi Sasada
3b0bcaf287 check multi_ractor mode at main_p
rb_ractor_main_p() need to access to the ractor pointer in TLS.
However it is slow operation so that we need to skip this check
if it is not multi-ractor mode (!ruby_multi_ractor).

This performance regression is pointed at
https://bugs.ruby-lang.org/issues/17100#note-27
2020-09-04 14:18:48 +09:00
Nobuyoshi Nakada
169b1d1aca
Initialize loop variables of list_for_each for MS VC 2020-09-04 11:46:50 +09:00
Alan Wu
d4585e7470 Avoid potential for rb_raise() while crashing
rb_obj_raw_info is called while printing out crash messages and
sometimes called during garbage collection. Calling rb_raise() in these
situations is undesirable because it can start executing ensure blocks.
2020-09-03 17:41:58 -04:00
git
e0a749c045 * 2020-09-04 [ci skip] 2020-09-04 04:09:05 +09:00
Koichi Sasada
3f922f3b77 don't use toplevel return
Toplevel return is supported after Ruby 2.4, so don't use it
for older BASERUBY.
2020-09-04 04:07:34 +09:00
Koichi Sasada
b52513e2a1 skip Ractor tests on Compiler tests
This implementation has memory corruption errors so and
it causes BUG on rare occasions. This commit skips
suspect tests on Github actions Compiler tests.
2020-09-03 21:11:06 +09:00
Koichi Sasada
79df14c04b Introduce Ractor mechanism for parallel execution
This commit introduces Ractor mechanism to run Ruby program in
parallel. See doc/ractor.md for more details about Ractor.
See ticket [Feature #17100] to see the implementation details
and discussions.

[Feature #17100]

This commit does not complete the implementation. You can find
many bugs on using Ractor. Also the specification will be changed
so that this feature is experimental. You will see a warning when
you make the first Ractor with `Ractor.new`.

I hope this feature can help programmers from thread-safety issues.
2020-09-03 21:11:06 +09:00
Nobuyoshi Nakada
eeb5325d3b
Hoisted out warn_deprecated 2020-09-03 18:51:48 +09:00
Kazuhiro NISHIYAMA
705b908f7d
Fix a typo [ci skip] 2020-09-03 17:54:00 +09:00
Alan Wu
7b9ef66747 Don't call to_s in const_set
Follow up for 5e16857315. Calling a method
in the middle of const_set adds a way that it would fail. It also makes
it inconsistent with declaring a constant using `::`, which doesn't call
`to_s`.
2020-09-03 16:49:45 +09:00
卜部昌平
50b18e8129 configure: detect that there is no g++
AC_PROG_CXX checks for several C++ compilers INCLUDING g++.  When none
of them were found it sets the CXX variable to be g++.  This doesn't
make any sense.  Absense of g++ has already been made sure.

Because we don't want insanity (that's the whole reason we test the
environment using autoconf), we need to swipe such insane variable out.
2020-09-03 15:14:09 +09:00
Aaron Patterson
3fb255625b
add lldb functions for getting the heap page / heap page body 2020-09-02 16:45:54 -07:00
Aaron Patterson
933035d303
support T_MATCH in lldb 2020-09-02 16:45:13 -07:00
John Hawthorn
0b81a484f3 Initialize new T_OBJECT as ROBJECT_EMBED
Previously, when an object is first initialized, ROBJECT_EMBED isn't
set. This means that for brand new objects, ROBJECT_NUMIV(obj) is 0 and
ROBJECT_IV_INDEX_TBL(obj) is NULL.

Previously, this combination meant that the inline cache would never be
initialized when setting an ivar on an object for the first time since
iv_index_tbl was NULL, and if it were it would never be used because
ROBJECT_NUMIV was 0. Both cases always fell through to the generic
rb_ivar_set which would then set the ROBJECT_EMBED flag and initialize
the ivar array.

This commit changes rb_class_allocate_instance to set the ROBJECT_EMBED
flag on the object initially and to initialize all members of the
embedded array to Qundef. This allows the inline cache to be set
correctly on first use and to be used on future uses.

This moves rb_class_allocate_instance to gc.c, so that it has access to
newobj_of. This seems appropriate given that there are other allocating
methods in this file (ex. rb_data_object_wrap, rb_imemo_new).
2020-09-02 14:54:29 -07:00
eileencodes
eada635033 Add category to rb_warn_deprecated
PR https://github.com/ruby/ruby/pull/3418 added a category to
`rb_warn_deprecated_to_remove` but not to `rb_warn_deprecated`. This
adds the same code to `rb_warn_deprecated` so that those warnings also
get a category.

This change also adds tests for `rb_warn_deprecated` and updates the
tests for `rb_warn_deprecated_to_remove` to have clearer names.

I've fixed the call to `rb_method_entry` as we need to be using the
instance method, not singleton.

Feature: https://bugs.ruby-lang.org/issues/17122
2020-09-02 12:44:33 -07:00
Burdette Lamar
54fb8fb62a
Comply with guide for method doc: array.c (#3506)
Methods:

    any?
    all?
    one?
    none?
    sum
    shuffle!
    shuffle
    sample
2020-09-02 14:02:34 -05:00
Jeremy Evans
d9b8411a7b Document that StringScanner#matched_size returns size in bytes [ci skip]
Fixes [Bug #17139]
2020-09-02 10:41:49 -07:00
git
0938bad0a5 * 2020-09-03 [ci skip] 2020-09-03 02:38:01 +09:00
Jeremy Evans
cc5b7ed1dc Document limitation of Pathname#relative_path_from [ci skip]
This method is explicitly documented to not access the filesystem,
and the only way to get the correct behavior for a case where the
filesystem's case sensitivity differs from the operating system
default would be to access the filesystem.

Fixes [Bug #15417]
2020-09-02 10:34:33 -07:00
Nobuyoshi Nakada
93b78abd77
new_dstr: hoisted out from literal_concat and evstr2dstr 2020-09-02 13:30:16 +09:00
Nobuyoshi Nakada
6321330461
Removed trailing spaces [ci skip] 2020-09-02 13:30:16 +09:00
Marc-Andre Lafortune
5e16857315 Fix constant names set using const_set on a singleton class
Fixes [Bug #14895]
2020-09-02 00:05:14 -04:00
Peter Zhu
11922b5e03 Fix error message for wb unprotected objects count
This error is about wb unprotected objects, not old objects.
2020-09-01 22:03:13 -04:00
Alan Wu
4c3f0597de Remove the pc argument of vm_trace()
This makes the binary 272 bytes smaller on -O3 GCC 10.2.0.
2020-09-01 22:02:29 -04:00
Marc-Andre Lafortune
94b54b038c Reapply "Special case Range#max for integer beginning and Float::Infinity end" (tests)
Reverted in e080a4cdee
2020-09-01 21:02:12 -04:00
eileencodes
6e8ec9ab6d Support passing a category to Warning.warn
This change adds a `category` kwarg to make it easier to monkey patch
`Warning.warn`. Warnings already have a category, but that warning isn't
exposed. This implements a way to get the category so that warnings with
a specific category, like deprecated, can be treated differently than
other warnings in an application.

The change here does an arity check on the method to support backwards
compatibility for applications that may already have a warning monkey
patch.

For our usecase we want to `raise` for deprecation warnings in order to
get the behavior for the next Ruby version. For example, now that we
fixed all our warnings and deployed Ruby 2.7 to production, we want to
be able to have deprecation warnings behave like they would in 3.0: raise
an error. For other warnings, like uninialized constants, that behavior
won't be removed from Ruby in the next version, so we don't need to
raise errors.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2020-09-01 16:16:06 -07:00
Jeremy Evans
de10a1f358 Update documentation for Range#max 2020-09-01 10:52:47 -07:00
Jeremy Evans
4db4faef0f Revert "Fix Range#{max,minmax} for range with integer beginning and non-integer end"
This reverts commit 8900a25581.
2020-09-01 10:52:47 -07:00
Jeremy Evans
e080a4cdee Revert "Special case Range#max for integer beginning and Float::Infinity end"
This reverts commit 05bf811c28.
2020-09-01 10:52:47 -07:00
Burdette Lamar
94430d009a
Comply with guide for method doc: array.c (#3499)
Methods considered:

    count
    flatten!
    flatten
    cycle
    permutation
    combination
    repeated_permutation
    repeated_combination
    product
    take
    take_while
    drop
    drop_while
2020-09-01 12:49:48 -05:00
git
9d4c51478c * 2020-09-02 [ci skip] 2020-09-02 01:46:35 +09:00
Nobuyoshi Nakada
41cf17bef0
Fixed argument types 2020-09-02 01:41:20 +09:00
Nobuyoshi Nakada
f6822e4ed0
Format with proper conversion specifiers instead of casts 2020-09-02 01:41:18 +09:00
Jeremy Evans
be9dbe1c3e Fix pthread_setname_np arguments on NetBSD
The previous attempt to fix this in
b87df1bf24 reversed the argument
order instead of just fixing the quote escaping.

From Takahiro Kambe.

Fixes [Bug #15178]
2020-09-01 07:16:31 -07:00
David Rodríguez
6b43200948 Fix syncing bundler man pages
`rm_rf` does not support globbing, so not all files get deleted.
2020-09-01 21:18:15 +09:00
Nobuyoshi Nakada
8d1de3154c
Use RSTRING_LENINT for overflow check 2020-09-01 19:03:41 +09:00