Commit graph

7185 commits

Author SHA1 Message Date
卜部昌平
3df37259d8 drop-in type check for rb_define_singleton_method
We can check the function pointer passed to
rb_define_singleton_method like how we do so in rb_define_method.
Doing so revealed many arity mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平
7b6fde4258 drop-in type check for rb_define_module_function
We can check the function pointer passed to rb_define_module_function
like how we do so in rb_define_method.  The difference is that this
changeset reveales lots of atiry mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平
48e346a088 fix arity of bug_start
This is just a trivial mistake introduced in
0f36e8fc03.
2019-08-29 18:34:09 +09:00
Nobuyoshi Nakada
2ed68d0ff9
Revert "Add pipeline operator [Feature #15799]"
This reverts commits:
* d365fd5a02
* d780c36624
* aa7211836b
* 043f010c28
* bb4dd7c6af05c7821d572e2592ea3d0cc748d81f
* 043f010c28
* f169043d81

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/94645
2019-08-29 15:27:59 +09:00
卜部昌平
6dd60cf114 st_foreach now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
st_foreach.  I strongly believe that this commit should have had come
with b0af0592fd, which added extra
parameter to st_foreach callbacks.
2019-08-27 15:52:26 +09:00
卜部昌平
af5e256640 rb_catch now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_catch, and fixes some bugs revealed by that.
2019-08-27 15:52:26 +09:00
卜部昌平
703783324c rb_ensure now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_ensure, which also revealed many arity / type mismatches.
2019-08-27 15:52:26 +09:00
卜部昌平
5c7c2d9951 rb_rescue / rb_rescue2 now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_rescue / rb_rescue2, which revealed many arity / type mismatches.
2019-08-27 15:52:26 +09:00
卜部昌平
3cae73133c rb_iterate now takes rb_block_call_func_t
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit makes rb_iterate free
from ANYARGS.
2019-08-27 15:52:26 +09:00
Yusuke Endoh
571ffcd609 ext/psych/yaml/api.c: Suppress a "variable set but not used" warning
```
compiling ../.././ext/psych/yaml/api.c
../.././ext/psych/yaml/api.c: In function 'yaml_document_delete':
../.././ext/psych/yaml/api.c:1122:7: warning: variable 'context' set but not used [-Wunused-but-set-variable]
     } context;
       ^~~~~~~
```
20190824T093004Z.log.html.gz
2019-08-24 20:31:16 +09:00
Nobuyoshi Nakada
2e28b3678f [ruby/stringio] Fixed a typo
b249631c43 (commitcomment-34804150)

998d6257fb
2019-08-23 20:52:53 +09:00
Nobuyoshi Nakada
a5b809e994
Check metadata a bit more 2019-08-23 13:00:17 +09:00
Nobuyoshi Nakada
650cd24555
Hoisted out get_digest_obj_metadata 2019-08-23 12:27:48 +09:00
Nobuyoshi Nakada
a963851100
Hoisted out rb_id_metadata 2019-08-22 00:19:56 +09:00
Nobuyoshi Nakada
74c6662af5
Hoisted out rb_digest_namespace 2019-08-22 00:19:55 +09:00
Nobuyoshi Nakada
3df9f3cc13
Separated initializing IDs 2019-08-21 16:20:31 +09:00
Nobuyoshi Nakada
619f82bb6b
Hoisted out unixsocket_len, triming NUL chars from sun_path 2019-08-16 17:44:45 +09:00
Nobuyoshi Nakada
cad41bb6d3
[ruby/stringio] Supported BOM
b249631c43
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada
22e942deb2
[ruby/stringio] Supported mode: option
53def32ba0
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada
8b44307894
[ruby/stringio] Allow bignum mode
d28927b561
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada
e54d349a01
[ruby/stringio] Added support for older versions
c4a13d41cd
359c9f395c
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada
c8f9e9a2a0
[ruby/stringio] stringio: encoding support
7b20075ab0
2019-08-14 11:20:57 +09:00
Nobuyoshi Nakada
3fc10eff1e
date_parse.c: trim off
* ext/date/date_parse.c (date_zone_to_diff): trim off by zone name
  length.
2019-08-12 20:41:11 +09:00
Nobuyoshi Nakada
d96feee37c
date_parse.c: avoid copying
* ext/date/date_parse.c (date_zone_to_diff): get rid of copying
  the whole argument string.
2019-08-12 20:41:11 +09:00
Nobuyoshi Nakada
ffdef3674a
Warn instance variable E
It is not dumped, as it is a short alias for `:encoding`.
2019-08-10 13:18:41 +09:00
Yusuke Endoh
8877dbe400 ext/ripper/lib/ripper/lexer.rb: Consistently use Array#push
instead of <<.  All the other callsites use `push`.
2019-08-07 03:13:17 +09:00
Yusuke Endoh
ef8c5161b4 ext/ripper/lib/ripper/lexer.rb: fix a wrong delegation
The target method name is a typo.
2019-08-07 03:12:49 +09:00
Jeremy Evans
2b6441196e Remove documentation of %m in Syslog
Fixes [Bug #6726]
2019-08-05 16:10:25 -07:00
Yusuke Endoh
58a478bce4 ext/psych/yaml/loader.c: Cast the difference of pointers to int
instead of casting a pointer to int.
Follow up of 39622232c7.
2019-08-05 14:38:59 +09:00
Hiroshi SHIBATA
39622232c7
Suppress warnings of bundled libyaml. 2019-08-04 20:12:43 +09:00
David Carlier
2d189a6721
yaml few build warning fixes
Closes: https://github.com/ruby/ruby/pull/2283
2019-08-04 09:46:46 +09:00
Dmitry Petrashko
b6cfacc85d
Remove dependency on openssl/conf_api.h
None of the functions defined in this header are actually used in Ruby.
Fixes build against boringssl that does not have this file.
Closes: https://github.com/ruby/ruby/pull/2210
2019-08-04 09:25:32 +09:00
Yusuke Endoh
b8e351a1b9 ext/-test-/bug-14834/bug-14384.c: fallback for MAYBE_UNUSED
__unused__ is unavailable on Sun C.
20190801T112505Z.fail.html.gz
2019-08-01 21:09:59 +09:00
卜部昌平
fd0e3bd249 fix VC 2013 compile error
It seems the compiler does not support VLAs.
See also: 26392589/job/px6nuiuw4e78weg1
2019-08-01 16:19:49 +09:00
卜部昌平
5d33f78716 fix tracepoint + backtrace SEGV
PC modification in gc_event_hook_body was careless.  There are (so
to say) abnormal iseqs stored in the cfp.  We have to check sanity
before we touch the PC.

This has not been fixed because there was no way to (ab)use the
setup from pure-Ruby.  However by using our official C APIs it is
possible to touch such frame(s), resulting in SEGV.

Fixes [Bug #14834].
2019-08-01 16:00:59 +09:00
git
e315f3a134 * expand tabs. 2019-07-31 10:22:47 +09:00
Koichi Sasada
72825c35b0 Use 1 byte hint for ar_table [Feature #15602]
On ar_table, Do not keep a full-length hash value (FLHV, 8 bytes)
but keep a 1 byte hint from a FLHV (lowest byte of FLHV).
An ar_table only contains at least 8 entries, so hints consumes
8 bytes at most. We can store hints in RHash::ar_hint.

On 32bit CPU, we use 4 entries ar_table.

The advantages:
* We don't need to keep FLHV so ar_table only consumes
  16 bytes (VALUEs of key and value) * 8 entries = 128 bytes.
* We don't need to scan ar_table, but only need to check hints
  in many cases. Especially we don't need to access ar_table
  if there is no match entries (in many cases).
  It will increase memory cache locality.

The disadvantages:
* This technique can increase `#eql?` time because hints can
  conflicts (in theory, it conflicts once in 256 times).
  It can introduce incompatibility if there is a object x where
  x.eql? returns true even if hash values are different.
  I believe we don't need to care such irregular case.
* We need to re-calculate FLHV if we need to switch from ar_table
  to st_table (e.g. exceeds 8 entries).
  It also can introduce incompatibility, on mutating key objects.
  I believe we don't need to care such irregular case too.

Add new debug counters to measure the performance:
* artable_hint_hit - hint is matched and eql?#=>true
* artable_hint_miss - hint is not matched but eql?#=>false
* artable_hint_notfound - lookup counts
2019-07-31 09:52:03 +09:00
Nobuyoshi Nakada
077c28887a
[ruby/io-console] Do not use add_development_dependency
bc77f46391
2019-07-25 08:16:57 +09:00
Nobuyoshi Nakada
414d6cf1d3 [ruby/psych] Get rid of C90 feature
For ruby 2.6 and earlier.

562435717 (L245-L248)

```
../../../../ext/psych/psych_parser.c: In function ‘make_exception’:
../../../../ext/psych/psych_parser.c:87:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     VALUE ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
     ^
```

aa457443b8
2019-07-25 07:52:19 +09:00
Jean Boussier
6ca7dc69ef [ruby/psych] Deduplicate hash keys if they're strings
0414982ffd
2019-07-25 07:52:16 +09:00
Hiroshi SHIBATA
50076903ab
[ruby/psych] Drop to support fat gem support.
ref. https://github.com/ruby/bigdecimal/pull/149

25ae263252
2019-07-25 07:50:37 +09:00
Hiroshi SHIBATA
938032a790
[ruby/psych] Do not use add_development_dependency.
939754237f
2019-07-25 07:47:07 +09:00
Jeremy Evans
9095ff53cf [ruby/date] Describe what is meant by valid in the Date.valid_date? rdoc
8eca79d1f0
2019-07-22 17:36:20 +09:00
Nobuyoshi Nakada
8deabcd328
Constified afamily functions 2019-07-16 18:42:56 +09:00
Nobuyoshi Nakada
75fb0a9afa
Allow mday in Date.iso8601 to be omitted
[Bug #12285]
2019-07-16 09:41:23 +09:00
Koichi Sasada
223854ebe8 catch up e8ddbc0239. 2019-07-15 09:58:26 +09:00
Yusuke Endoh
deb5e58230 ext/stringio/stringio.c (strio_read): "binray" is always zero here
Remove unused conditional expression to suppress Coverity Scan warnings.
2019-07-15 00:20:32 +09:00
Yusuke Endoh
80da68db1e Add a /* fall through */ comment 2019-07-14 23:36:23 +09:00
Tanaka Akira
4900a10689 socket: use frozen string buffer when releasing GVL
Thanks for the patch by normalperson (Eric Wong) [Bug #14204].
2019-07-14 20:46:51 +09:00
Nobuyoshi Nakada
715955ff27
Include ruby/assert.h in ruby/ruby.h so that assertions can be there 2019-07-14 17:58:03 +09:00