67228 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
d140b03053
Added ruby/un entry 2021-08-24 18:02:44 +09:00
Jun Aruga
2be84afea5 .github/workflows/compilers.yml: Specify a container running user as root.
Explicitly specify the root as a user to run tests in the containers.

Coming new ruby/ruby-ci-image images are required to run the container as
a regular user by default, while the root user is required to run the
compilers.yml. Add `id` command to print the user info.

Co-authored-by: fedor <fedor@cirruslabs.org>
2021-08-24 10:55:24 +02:00
Yusuke Endoh
22deda43cb tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf
Formerly, TypeProf was tested with the latest RBS code during
`make test-bundled-gems`. However, when a new version of rbs is
released, and if it is incompatible with TypeProf,
`make test-bundled-gems` starts failing, which was annoying.

By this change, TypeProf is tested with the bundled version of RBS.
2021-08-24 17:43:11 +09:00
Nobuyoshi Nakada
bcc5a2b67e [ruby/fiddle] Simplify libc and libm path logics (https://github.com/ruby/fiddle/pull/91)
* Simplify libc_so and libm_so

If nil, no need to set to nil.

* Get rid of repeating inversions

https://github.com/ruby/fiddle/commit/4323e689d8
2021-08-24 16:18:24 +09:00
Aaron Patterson
0f1e8f38c9 [ruby/fiddle] Improve "offsetof" calculations (https://github.com/ruby/fiddle/pull/90)
I need to get the offset of members inside sub structures.  This patch
adds sub-structure offset support for structs.

https://github.com/ruby/fiddle/commit/cf78eddbb6
2021-08-24 16:18:22 +09:00
David Carlier
8d2af51a78 netbsd coroutine uses assembly instead and little build fix. 2021-08-24 10:52:04 +09:00
Nobuyoshi Nakada
d9f084ed14 Moved rb_deprecate_constant declaration [Feature #18051] 2021-08-24 10:37:41 +09:00
Nobuyoshi Nakada
5d99800d01 Moved rb_int_positive_pow declaration [Feature #18051] 2021-08-24 10:37:41 +09:00
Nobuyoshi Nakada
c38c2d8ee2 Moved exported symbols in internal/util.h to ruby/util.h
[Feature #18051]
2021-08-24 10:37:41 +09:00
S-H-GAMELINKS
4794a8a7cf Add stat_time function 2021-08-24 09:23:07 +09:00
git
70abda1ad4 * 2021-08-24 [ci skip] 2021-08-24 03:58:11 +09:00
Peter Zhu
6648b411f7 Replace intptr_t with uintptr_t in gc.c
Pointers may be large to the point where intptr_t would be negative.
This is problematic when doing comparisons of pointers.
2021-08-23 14:57:52 -04:00
Peter Zhu
eddd369e73 Revert "[Feature #18045] Implement size classes for GC"
This reverts commits 48ff7a9f3e47bffb3e4d067a12ba9b936261caa0
and b2e2cf2dedd104acad8610721db5e4d341f135ef because it is causing
crashes in SPARC solaris and i386 debian.
2021-08-23 10:54:53 -04:00
Peter Zhu
b2e2cf2ded [Feature #18045] Implement size classes for GC
This commits implements size classes in the GC for the Variable Width
Allocation feature. Unless `USE_RVARGC` compile flag is set, only a
single size class is created, maintaining current behaviour. See the
redmine ticket for more details.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-08-23 09:15:42 -04:00
Peter Zhu
48ff7a9f3e [Feature #18045] Remove T_PAYLOAD
This commit removes T_PAYLOAD since the new VWA implementation no longer
requires T_PAYLOAD types.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-08-23 09:15:42 -04:00
Nobuyoshi Nakada
83244b8c89
[DOC] Match each Time.now for comparison [ci skip] 2021-08-23 14:12:21 +09:00
git
116e52f3b4 * 2021-08-23 [ci skip] 2021-08-23 09:59:31 +09:00
Kentaro Goto
689962eaea improves message. thanks to eregon 2021-08-23 09:59:09 +09:00
Kentaro Goto
f18e1752dc Display httpd URLs supporting HTTPS 2021-08-23 09:59:09 +09:00
Kentaro Goto
8361675e3a Display httpd URLs 2021-08-23 09:59:09 +09:00
Kazuhiro NISHIYAMA
d7da5ca5e1
Fix links [ci skip] 2021-08-22 22:27:29 +09:00
Nobuyoshi Nakada
0b9a3371ea [ruby/date] Add zontab.list dependency
https://github.com/ruby/date/commit/7e1ffbf568
2021-08-22 20:28:52 +09:00
Nobuyoshi Nakada
877bfd1b44
Suppress unused-label warnings 2021-08-22 20:16:44 +09:00
Nobuyoshi Nakada
d574b84182
Fix failures on non-UTF-8 environment [Bug #18077]
Call `IOSpecs.io_fixture` with the default encoding explicitly.
`IOSpecs.closed_io` calls the method without optional `mode` which
is set to UTF-8 by default, while the default external encoding
depends on the locale environment variables.
2021-08-22 12:11:45 +09:00
S-H-GAMELINKS
18031f4102 Add rb_encoding_check function 2021-08-22 10:39:14 +09:00
Lars Kanis
6594623f62 Fix Marshal.dump(closed_io) to raise TypeError and allow encoding on closed IO
Mashalling a closed IO object raised "closed stream (IOError)" before instead of TypeError.
This changes IO#(in|ex)ternal_encoding to still return the encoding even if the underlying FD is closed.

Fixes bug #18077
2021-08-22 10:33:22 +09:00
Soutaro Matsumoto
c527d278a3
Bundle RBS 1.5.1 (#4760) 2021-08-22 02:47:54 +09:00
git
ad99edc7db * 2021-08-22 [ci skip] 2021-08-22 02:15:17 +09:00
Jeremy Evans
48c8df9e0e
Allow tracing of optimized methods
This updates the trace instructions to directly dispatch to
opt_send_without_block.  So this should cause no slowdown in
non-trace mode.

To enable the tracing of the optimized methods, RUBY_EVENT_C_CALL
and RUBY_EVENT_C_RETURN are added as events to the specialized
instructions.

Fixes [Bug #14870]

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2021-08-21 10:15:01 -07:00
Nobuyoshi Nakada
f51a6ace06
[DOC] prefer RUBY_DEFAULT_FREE to a magic number [ci skip] 2021-08-21 16:50:51 +09:00
Nobuyoshi Nakada
8f755ad6c8
[DOC] mention rb_define_alloc_func [ci skip] 2021-08-21 16:48:13 +09:00
git
e2b2b577b6 * 2021-08-21 [ci skip] 2021-08-21 11:22:11 +09:00
Nobuyoshi Nakada
5e7cc0eebe
[DOC] update extension.ja.rdoc [ci skip]
`rb_cData` has been deprecated for years.
2021-08-21 11:21:37 +09:00
Yusuke Endoh
5e9598baea [ruby/error_highlight] Fixed the argument for DidYouMean.formatter=
Looks like this bug was hidden by did_you_mean's rescuing any
exceptions.

https://github.com/ruby/error_highlight/commit/7a8f0b4796
2021-08-20 16:27:07 +09:00
Yusuke Endoh
cad83fa3c4 ast.c: Rename "save_script_lines" to "keep_script_lines"
... as per ko1's preference. He is preparing to extend this feature to
ISeq for his new debugger. He prefers "keep" to "save" for this wording.
This API is internal and not included in any released version, so I
change it in advance.
2021-08-20 16:18:36 +09:00
Nobuyoshi Nakada
4c93c124c2
Turned the reminder comment to a compile-time message 2021-08-20 15:18:13 +09:00
Nobuyoshi Nakada
371bb4eadd
Add RBIMPL_TODO
Make `RUBY_VERSION_SINCE` and `RUBY_VERSION_BEFORE` to take major
and minor numbers so usable also in preprocessor directives.  Old
macros are renamed with "STRING".
2021-08-20 15:18:12 +09:00
Nobuyoshi Nakada
b32987a3d7
Simplify repeated member access macros 2021-08-20 14:04:07 +09:00
Shugo Maeda
754adbee91
Module#ancestors should not return superclasses of refinements
[ruby-core:86949] [Bug #14744]

Reported by Eregon (Benoit Daloze).  Thanks!
2021-08-20 10:42:01 +09:00
git
70510d1545 * 2021-08-20 [ci skip] 2021-08-20 08:30:24 +09:00
Mike Dalessio
c0f4e4ca6d undefine alloc functions for C extensions
per guidance in doc/extension.rdoc, these classes now undefine their
alloc functions:

- ObjectSpace::InternalObjectWrapper
- Socket::Ifaddr
2021-08-20 08:30:06 +09:00
Mike Dalessio
e8e3b7a0e2 Undefine the alloc function for T_DATA classes
which have not undefined or redefined it.

When a `T_DATA` object is created whose class has not undefined or
redefined the alloc function, the alloc function now gets undefined by
Data_Wrap_Struct et al. Optionally, a future release may also warn
that this being done.

This should help developers of C extensions to meet the requirements
explained in "doc/extension.rdoc". Without a check like this, there is
no easy way for an author of a C extension to see where they have made
a mistake.
2021-08-20 08:30:06 +09:00
Nobuyoshi Nakada
6963f8f743
Remove old warning aged nearly 8 years 2021-08-19 17:44:48 +09:00
Kazuki Tsujimoto
f96c199449
Fix test failure on spec/ruby/language/pattern_matching_spec.rb
https://github.com/ruby/ruby/runs/3369486308
2021-08-19 17:28:30 +09:00
Kazuki Tsujimoto
ecb6d6a4ef
Allow omission of parentheses in one line pattern matching [Feature #16182] 2021-08-19 17:07:58 +09:00
Nobuyoshi Nakada
00d66f7ec2
Hard-link executable files to mae runnable
As `$ORIGIN` on Linux is refered from the real path of the
executable file, symbolic linked executable file cannot work.
2021-08-19 16:10:35 +09:00
git
e20e97b4c0 * 2021-08-19 [ci skip] 2021-08-19 11:33:29 +09:00
Soutaro Matsumoto
1985a3a77f
Bundle RBS 1.4.0 & typeprof 0.15.2 (#4753)
* Bundle RBS 1.4.0

* Bundle typeprof 0.15.2
2021-08-19 11:33:09 +09:00
Daniel Niknam
0b7969b6a3 Silence LoadError only if it is for rubygems itself
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2021-08-18 21:37:31 +09:00
John Hawthorn
d668cd188c rb_fix2uint should use FIXNUM_NEGATIVE_P
rb_num_negative_int_p is equivalent to calling the "<" method on
Integer (and checking whether it is overridden), where in this case we
are interested in whether the "actual" value can fit inside an unsigned
int.

This also was slow because rb_num_negative_int_p calls
rb_method_basic_definition_p, doing a method lookup to check for < being
overridden.

This replaces the check in both rb_fix2uint and rb_fix2ushort with FIXNUM_NEGATIVE_P which simply checks
whether the VALUE is signed.
2021-08-18 18:24:37 +09:00