8000 Merge branch 'master' into auto-compact · github/ruby@1a84cba · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a84cba

Browse files
committed
Merge branch 'master' into auto-compact
* master: (32 commits) Update method tables only if there is a class ext pointer Fix .travis.yml to keep s390x-linux as allow_features Move s390x-linux to allow_failures matrix [ruby/forwardable] Bump version to 1.3.1 [ruby/forwardable] Make def_*_delegator return name of method defined (Fixes #10) The result of Readline.completion_proc should have the same encoding of Encoding.default_external Test `Thread#to_s` when used from to_s_spec.rb `Thread#to_s` has been added at ruby 2.5 skip continuous failure test. Thread#to_s is not same as #inspect on old version. rely on sorted compiled binary array. Show the failed message Try to use `set-output` fix for old MRI versions add depenency pointed by update-deps Create dummy files when check only Do not load q.rb in build directory Create more dummy files in build directory Do not load files in build directory Fix Enumerator::Lazy#with_index ...
2 parents be09a4e + 0f90630 commit 1a84cba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+406
-335
lines changed

.github/workflows/cygwin.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ jobs:
5454
git -C src reset --hard ${{ github.event.pull_request.head.sha }}
5555
if: github.event_name == 'pull_request'
5656
shell: cmd
57-
- name: Actions-commit-info.sh
58-
run: |
59-
bash ./src/tool/actions-commit-info.sh
60-
shell: cmd
57+
- run: ./src/tool/actions-commit-info.sh
58+
shell: bash
59+
id: commit_info
6160
- name: Autoconf
6261
run: |
6362
cd src

.github/workflows/macos.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
3636
if: github.event_name == 'pull_request'
3737
- run: ./src/tool/actions-commit-info.sh
38+
id: commit_info
3839
- name: Install libraries
3940
run: |
4041
export WAITS='5 60'
@@ -69,7 +70,7 @@ jobs:
6970
payload: |
7071
{
7172
"attachments": [{
72-
"text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
73+
"text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
7374
"(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
7475
"of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
7576
"color": "danger"

.github/workflows/mjit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
3737
if: github.event_name == 'pull_request'
3838
- run: ./src/tool/actions-commit-info.sh
39+
id: commit_info
3940
- name: Fixed world writable dirs
4041
run: |
4142
chmod go-w $HOME
@@ -67,7 +68,7 @@ jobs:
6768
payload: |
6869
{
6970
"attachments": [{
70-
"text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.jit_opts }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
71+
"text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.jit_opts }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
7172
"(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
7273
"of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
7374
"color": "danger"

.github/workflows/ubuntu.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
6969
if: github.event_name == 'pull_request'
7070
- run: ./src/tool/actions-commit-info.sh
71+
id: commit_info
7172
- name: Fixed world writable dirs
7273
run: |
7374
chmod go-w $HOME
@@ -87,6 +88,11 @@ jobs:
8788
- name: Extract gems
8889
run: make -C build update-gems extract-gems
8990
if: matrix.test_task == 'check'
91+
- name: Create dummy files in build dir
92+
run: |
93+
cd build
94+
./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'
95+
if: matrix.test_task == 'check'
9096
- name: Tests
9197
run: make -C build $JOBS -s ${{ matrix.test_task }}
9298
env:
@@ -98,7 +104,7 @@ jobs:
98104
payload: |
99105
{
100106
"attachments": [{
101-
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
107+
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
102108
"(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
103109
"of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
104110
"color": "danger"

.github/workflows/windows.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
if: github.event_name == 'pull_request'
5151
- run: ./src/tool/actions-commit-info.sh
5252
shell: bash
53+
id: commit_info
5354
- name: Configure
5455
run: |
5556
md build
@@ -78,7 +79,7 @@ jobs:
7879
payload: |
7980
{
8081
"attachments": [{
81-
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
82+
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
8283
"(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
8384
"of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
8485
"color": "danger"

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ matrix:
439439
- <<: *CALL_THREADED_CODE
440440
- <<: *NO_THREADED_CODE
441441
allow_failures:
442+
- name: s390x-linux
442443
- name: -fsanitize=address
443444
- name: -fsanitize=memory
444445
- name: -fsanitize=undefined

bootstraptest/test_thread.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
}
4646
}
4747
rescue ThreadError => e
48-
:ok if /can't create Thread/ =~ e.message
48+
/can't create Thread/ =~ e.message ? :ok : e.message
4949
end
5050
}
5151
assert_equal %q{ok}, %q{

builtin.c

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,33 @@
33
#include "iseq.h"
44
#include "builtin.h"
55

6+
#if CROSS_COMPILING
7+
8+
#define INCLUDED_BY_BUILTIN_C 1
9+
#include "mini_builtin.c"
10+
11+
#else
12+
613
#include "builtin_binary.inc"
714

815
static const unsigned char*
916
builtin_lookup(const char *feature, size_t *psize)
1017
{
11-
for (int i=0; i<BUILTIN_BINARY_SIZE; i++) {
12-
if (strcmp(builtin_binary[i].feature, feature) == 0) {
13-
*psize = builtin_binary[i].bin_size;
14-
return builtin_binary[i].bin;
18+
static int index = 0;
19+
int i = index++;
20+
21+
// usually, `builtin_binary` order is loading order at miniruby.
22+
if (LIKELY(strcmp(builtin_binary[i].feature, feature) == 0)) {
23+
found:
24+
*psize = builtin_binary[i].bin_size;
25+
return builtin_binary[i].bin;
26+
}
27+
else {
28+
if (0) fprintf(stderr, "builtin_lookup: cached index miss (index:%d)\n", i);
29+
for (i=0; i<BUILTIN_BINARY_SIZE; i++) {
30+
if (strcmp(builtin_binary[i].feature, feature) == 0) {
31+
goto found;
32+
}
1533
}
1634
}
1735
rb_bug("builtin_lookup: can not find %s\n", feature);
@@ -36,8 +54,16 @@ rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin
3654
rb_iseq_eval(iseq);
3755
}
3856

57+
#endif
58+
3959
void
4060
Init_builtin(void)
4161
{
42-
//
62+
// nothing
63+
}
64+
65+
void
66+
Init_builtin_features(void)
67+
{
68+
rb_load_with_builtin_functions("gem_prelude", NULL);
4369
}

builtin.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef BUILTIN_H_INCLUDED
2+
#define BUILTIN_H_INCLUDED
3+
14
// invoke
25

36
struct rb_builtin_function {
@@ -66,3 +69,5 @@ struct builtin_binary {
6669
const unsigned char *bin; // binary by ISeq#to_binary
6770
size_t bin_size;
6871
};
72+
73+
#endif // BUILTIN_H_INCLUDED

common.mk

Lines changed: 14 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ NORMALMAINOBJ = main.$(OBJEXT)
7676
MAINOBJ = $(NORMALMAINOBJ)
7777
DLDOBJS = $(INITOBJS)
7878
EXTSOLIBS =
79-
MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT)
79+
MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT)
8080
ENC_MK = enc.mk
8181
MAKE_ENC = -f $(ENC_MK) V="$(V)" UNICODE_HDR_DIR="$(UNICODE_HDR_DIR)" \
8282
RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(mflags)
@@ -157,15 +157,15 @@ EXPORTOBJS = $(DLNOBJ) \
157157
loadpath.$(OBJEXT) \
158158
$(COMMONOBJS)
159159

160-
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT) builtin.$(OBJEXT)
160+
OBJS = $(EXPORTOBJS) builtin.$(OBJEXT)
161161
ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
162162

163163
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
164164

165165
DEFAULT_PRELUDES = $(GEM_PRELUDE)
166166
PRELUDE_SCRIPTS = $(DEFAULT_PRELUDES)
167-
GEM_PRELUDE = $(srcdir)/gem_prelude.rb
168-
PRELUDES = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
167+
GEM_PRELUDE =
168+
PRELUDES = {$(srcdir)}miniprelude.c
169169
GOLFPRELUDES = {$(srcdir)}golf_prelude.c
170170

171171
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
@@ -949,7 +949,6 @@ $(COROUTINE_H:/Context.h=/.time):
949949
# dependencies for generated C sources.
950950
parse.$(OBJEXT): {$(VPATH)}parse.c
951951
miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
952-
prelude.$(OBJEXT): {$(VPATH)}prelude.c
953952

954953
# dependencies for optional sources.
955954
compile.$(OBJEXT): {$(VPATH)}opt_sc.inc {$(VPATH)}optunifs.inc
@@ -1003,6 +1002,7 @@ BUILTIN_RB_SRCS = \
10031002
$(srcdir)/pack.rb \
10041003
$(srcdir)/trace_point.rb \
10051004
$(srcdir)/prelude.rb \
1005+
$(srcdir)/gem_prelude.rb \
10061006
$(empty)
10071007
BUILTIN_RB_INCS = $(BUILTIN_RB_SRCS:.rb=.rbinc)
10081008

@@ -1087,12 +1087,6 @@ $(MINIPRELUDE_C): $(COMPILE_PRELUDE) $(BUILTIN_RB_SRCS)
10871087
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -o $@ \
10881088
$(srcdir)/template/prelude.c.tmpl $(BUILTIN_RB_SRCS)
10891089

1090-
$(PRELUDE_C): $(COMPILE_PRELUDE) \
1091-
$(PRELUDE_SCRIPTS)
1092-
$(ECHO) generating $@
1093-
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
1094-
$(srcdir)/template/prelude.c.tmpl $(PRELUDE_SCRIPTS)
1095-
10961090
$(GOLF_PRELUDE_C): $(COMPILE_PRELUDE) {$(srcdir)}golf_prelude.rb
10971091
$(ECHO) generating $@
10981092
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
@@ -1113,7 +1107,6 @@ probes.h: {$(VPATH)}probes.$(DTRACE_EXT)
11131107

11141108
prereq: incs srcs preludes PHONY
11151109

1116-
preludes: {$(VPATH)}prelude.c
11171110
preludes: {$(VPATH)}miniprelude.c
11181111
preludes: {$(srcdir)}golf_prelude.c
11191112

@@ -1122,7 +1115,7 @@ preludes: {$(srcdir)}golf_prelude.c
11221115
$(Q) $(BASERUBY) $(srcdir)/tool/mk_builtin_loader.rb $<
11231116

11241117
builtin_binary.inc: $(PREP) $(BUILTIN_RB_SRCS) $(srcdir)/tool/mk_builtin_binary.rb
1125-
$(Q) $(MINIRUBY) $(srcdir)/tool/mk_builtin_binary.rb
1118+
$(Q) $(MINIRUBY) $(srcdir)/tool/mk_builtin_binary.rb --cross=$(CROSS_COMPILING)
11261119

11271120
$(BUILTIN_RB_INCS): $(top_srcdir)/tool/mk_builtin_loader.rb
11281121

@@ -2361,60 +2354,37 @@ miniinit.$(OBJEXT): $(CCAN_DIR)/str/str.h
23612354
miniinit.$(OBJEXT): $(hdrdir)/ruby.h
23622355
miniinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
23632356
miniinit.$(OBJEXT): {$(VPATH)}assert.h
2357+
miniinit.$(OBJEXT): {$(VPATH)}ast.rb
23642358
miniinit.$(OBJEXT): {$(VPATH)}builtin.h
23652359
miniinit.$(OBJEXT): {$(VPATH)}config.h
23662360
miniinit.$(OBJEXT): {$(VPATH)}defines.h
23672361
miniinit.$(OBJEXT): {$(VPATH)}encoding.h
2362+
miniinit.$(OBJEXT): {$(VPATH)}gc.rb
2363+
miniinit.$(OBJEXT): {$(VPATH)}gem_prelude.rb
23682364
miniinit.$(OBJEXT): {$(VPATH)}id.h
23692365
miniinit.$(OBJEXT): {$(VPATH)}intern.h
23702366
miniinit.$(OBJEXT): {$(VPATH)}internal.h
2367+
miniinit.$(OBJEXT): {$(VPATH)}io.rb
23712368
miniinit.$(OBJEXT): {$(VPATH)}iseq.h
23722369
miniinit.$(OBJEXT): {$(VPATH)}method.h
23732370
miniinit.$(OBJEXT): {$(VPATH)}mini_builtin.c
23742371
miniinit.$(OBJEXT): {$(VPATH)}miniinit.c
2372+
miniinit.$(OBJEXT): {$(VPATH)}miniprelude.c
23752373
miniinit.$(OBJEXT): {$(VPATH)}missing.h
23762374
miniinit.$(OBJEXT): {$(VPATH)}node.h
23772375
miniinit.$(OBJEXT): {$(VPATH)}onigmo.h
23782376
miniinit.$(OBJEXT): {$(VPATH)}oniguruma.h
2377+
miniinit.$(OBJEXT): {$(VPATH)}pack.rb
2378+
miniinit.$(OBJEXT): {$(VPATH)}prelude.rb
23792379
miniinit.$(OBJEXT): {$(VPATH)}ruby_assert.h
23802380
miniinit.$(OBJEXT): {$(VPATH)}ruby_atomic.h
23812381
miniinit.$(OBJEXT): {$(VPATH)}st.h
23822382
miniinit.$(OBJEXT): {$(VPATH)}subst.h
23832383
miniinit.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
23842384
miniinit.$(OBJEXT): {$(VPATH)}thread_native.h
2385+
miniinit.$(OBJEXT): {$(VPATH)}trace_point.rb
23852386
miniinit.$(OBJEXT): {$(VPATH)}vm_core.h
23862387
miniinit.$(OBJEXT): {$(VPATH)}vm_opts.h
2387-
miniprelude.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
2388-
miniprelude.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
2389-
miniprelude.$(OBJEXT): $(CCAN_DIR)/list/list.h
2390-
miniprelude.$(OBJEXT): $(CCAN_DIR)/str/str.h
2391-
miniprelude.$(OBJEXT): $(hdrdir)/ruby.h
2392-
miniprelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
2393-
miniprelude.$(OBJEXT): {$(VPATH)}assert.h
2394-
miniprelude.$(OBJEXT): {$(VPATH)}ast.rb
2395-
miniprelude.$(OBJEXT): {$(VPATH)}config.h
2396-
miniprelude.$(OBJEXT): {$(VPATH)}defines.h
2397-
miniprelude.$(OBJEXT): {$(VPATH)}gc.rb
2398-
miniprelude.$(OBJEXT): {$(VPATH)}id.h
2399-
miniprelude.$(OBJEXT): {$(VPATH)}intern.h
2400-
miniprelude.$(OBJEXT): {$(VPATH)}internal.h
2401-
miniprelude.$(OBJEXT): {$(VPATH)}io.rb
2402-
miniprelude.$(OBJEXT): {$(VPATH)}iseq.h
2403-
miniprelude.$(OBJEXT): {$(VPATH)}method.h
2404-
miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
2405-
miniprelude.$(OBJEXT): {$(VPATH)}missing.h
2406-
miniprelude.$(OBJEXT): {$(VPATH)}node.h
2407-
miniprelude.$(OBJEXT): {$(VPATH)}pack.rb
2408-
miniprelude.$(OBJEXT): {$(VPATH)}prelude.rb
2409-
miniprelude.$(OBJEXT): {$(VPATH)}ruby_assert.h
2410-
miniprelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
2411-
miniprelude.$(OBJEXT): {$(VPATH)}st.h
2412-
miniprelude.$(OBJEXT): {$(VPATH)}subst.h
2413-
miniprelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
2414-
miniprelude.$(OBJEXT): {$(VPATH)}thread_native.h
2415-
miniprelude.$(OBJEXT): {$(VPATH)}trace_point.rb
2416-
miniprelude.$(OBJEXT): {$(VPATH)}vm_core.h
2417-
miniprelude.$(OBJEXT): {$(VPATH)}vm_opts.h
24182388
mjit.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
24192389
mjit.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
24202390
mjit.$(OBJEXT): $(CCAN_DIR)/list/list.h
@@ -2585,32 +2555,6 @@ parse.$(OBJEXT): {$(VPATH)}st.h
25852555
parse.$(OBJEXT): {$(VPATH)}subst.h
25862556
parse.$(OBJEXT): {$(VPATH)}symbol.h
25872557
parse.$(OBJEXT): {$(VPATH)}util.h
2588-
prelude.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
2589-
prelude.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
2590-
prelude.$(OBJEXT): $(CCAN_DIR)/list/list.h
2591-
prelude.$(OBJEXT): $(CCAN_DIR)/str/str.h
2592-
prelude.$(OBJEXT): $(hdrdir)/ruby.h
2593-
prelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
2594-
prelude.$(OBJEXT): {$(VPATH)}assert.h
2595-
prelude.$(OBJEXT): {$(VPATH)}config.h
2596-
prelude.$(OBJEXT): {$(VPATH)}defines.h
2597-
prelude.$(OBJEXT): {$(VPATH)}gem_prelude.rb
2598-
prelude.$(OBJEXT): {$(VPATH)}id.h
2599-
prelude.$(OBJEXT): {$(VPATH)}intern.h
2600-
prelude.$(OBJEXT): {$(VPATH)}internal.h
2601-
prelude.$(OBJEXT): {$(VPATH)}iseq.h
2602-
prelude.$(OBJEXT): {$(VPATH)}method.h
2603-
prelude.$(OBJEXT): {$(VPATH)}missing.h
2604-
prelude.$(OBJEXT): {$(VPATH)}node.h
2605-
prelude.$(OBJEXT): {$(VPATH)}prelude.c
2606-
prelude.$(OBJEXT): {$(VPATH)}ruby_assert.h
2607-
prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
2608-
prelude.$(OBJEXT): {$(VPATH)}st.h
2609-
prelude.$(OBJEXT): {$(VPATH)}subst.h
2610-
prelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
2611-
prelude.$(OBJEXT): {$(VPATH)}thread_native.h
2612-
prelude.$(OBJEXT): {$(VPATH)}vm_core.h
2613-
prelude.$(OBJEXT): {$(VPATH)}vm_opts.h
26142558
proc.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
26152559
proc.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
26162560
proc.$(OBJEXT): $(CCAN_DIR)/list/list.h

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,6 +3053,7 @@ AS_IF([test x"$cross_compiling" = xyes], [
30533053
XRUBY='$(MINIRUBY)'
30543054
TEST_RUNNABLE=no
30553055
CROSS_COMPILING=yes
3056+
AC_DEFINE(CROSS_COMPILING, 1)
30563057
], [
30573058
MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
30583059
MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'

enum.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ enum_size_over_p(VALUE obj, long n)
426426
* Returns an array containing all elements of +enum+
427427
* for which the given +block+ returns a true value.
428428
*
429+
* The <i>find_all</i> and <i>select</i> methods are aliases.
430+
* There is no performance benefit to either.
431+
*
429432
* If no block is given, an Enumerator is returned instead.
430433
*
431434
*
@@ -4026,6 +4029,10 @@ int_range_sum(VALUE beg, VALUE end, int excl, VALUE init)
40264029
* { 1 => 10, 2 => 20 }.sum([]) #=> [1, 10, 2, 20]
40274030
* "a\nb\nc".each_line.lazy.map(&:chomp).sum("") #=> "abc"
40284031
*
4032+
* If the method is applied to an Integer range without a block,
4033+
* the sum is not done by iteration, but instead using Gauss's summation
4034+
* formula.
4035+
*
40294036
* Enumerable#sum method may not respect method redefinition of "+"
40304037
* methods such as Integer#+, or "each" methods such as Range#each.
40314038
*/

0 commit comments

Comments
 (0)
0