Skip to content

Commit 7b01c16

Browse files
committed
New upstream version 3.2.1
1 parent 5b09256 commit 7b01c16

File tree

171 files changed

+3839
-3859
lines changed

Some content is hidden

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

171 files changed

+3839
-3859
lines changed

ChangeLog

Lines changed: 864 additions & 0 deletions
Large diffs are not rendered by default.

LEGAL

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,6 @@ mentioned below.
979979
{MIT License}[rdoc-label:label-MIT+License]
980980

981981
[lib/rubygems/resolver/molinillo]
982-
[lib/bundler/vendor/molinillo]
983982

984983
molinillo is under the following license.
985984

@@ -988,6 +987,15 @@ mentioned below.
988987

989988
{MIT License}[rdoc-label:label-MIT+License]
990989

990+
[lib/bundler/vendor/pub_grub]
991+
992+
pub_grub is under the following license.
993+
994+
>>>
995+
Copyright (c) 2018 John Hawthorn
996+
997+
{MIT License}[rdoc-label:label-MIT+License]
998+
991999
[lib/bundler/vendor/connection_pool]
9921000

9931001
connection_pool is under the following license.

ast.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ static VALUE
202202
node_id_for_backtrace_location(rb_execution_context_t *ec, VALUE module, VALUE location)
203203
{
204204
int node_id;
205+
206+
if (!rb_frame_info_p(location)) {
207+
rb_raise(rb_eTypeError, "Thread::Backtrace::Location object expected");
208+
}
209+
205210
node_id = rb_get_node_id_from_frame_info(location);
206211
if (node_id == -1) {
207212
return Qnil;

bignum.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4184,7 +4184,6 @@ rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits,
41844184
}
41854185
if (!c || ISSPACE(c)) --str;
41864186
if (end) len = end - str;
4187-
ASSERT_LEN();
41884187
}
41894188
c = *str;
41904189
c = conv_digit(c);

common.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,6 @@ update-config_files: PHONY
13751375

13761376
refresh-gems: update-bundled_gems prepare-gems
13771377
prepare-gems: $(HAVE_BASERUBY:yes=update-gems) $(HAVE_BASERUBY:yes=extract-gems)
1378-
prepare-gems: $(DOT_WAIT) $(HAVE_BASERUBY:yes=outdate-bundled-gems)
13791378
extract-gems: $(HAVE_BASERUBY:yes=update-gems)
13801379

13811380
update-gems$(gnumake:yes=-sequential): PHONY

compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12311,7 +12311,7 @@ ibf_load_iseq_each(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
1231112311
verify_call_cache(iseq);
1231212312

1231312313
RB_GC_GUARD(dummy_frame);
12314-
rb_vm_pop_frame(ec);
12314+
rb_vm_pop_frame_no_int(ec);
1231512315
}
1231612316

1231712317
struct ibf_dump_iseq_list_arg

ext/ripper/lib/ripper/lexer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def on_heredoc_beg(tok)
228228

229229
def on_heredoc_end(tok)
230230
@buf.push Elem.new([lineno(), column()], __callee__, tok, state())
231-
@buf = @stack.pop
231+
@buf = @stack.pop unless @stack.empty?
232232
end
233233

234234
def _push_token(tok)

ext/stringio/stringio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,8 +1340,9 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
13401340
str = strio_substr(ptr, ptr->pos, e - s - w, enc);
13411341
}
13421342
else {
1343-
if (n < e - s) {
1344-
if (e - s < 1024) {
1343+
if (n < e - s + arg->chomp) {
1344+
/* unless chomping, RS at the end does not matter */
1345+
if (e - s < 1024 || n == e - s) {
13451346
for (p = s; p + n <= e; ++p) {
13461347
if (MEMCMP(p, RSTRING_PTR(str), char, n) == 0) {
13471348
e = p + n;

gc.c

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10611,16 +10611,18 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
1061110611
#if USE_RVARGC
1061210612
VALUE new_root = any->as.string.as.heap.aux.shared;
1061310613
rb_str_update_shared_ary(obj, old_root, new_root);
10614+
#endif
10615+
}
1061410616

10615-
// if, after move the string is not embedded, and can fit in the
10616-
// slot it's been placed in, then re-embed it
10617-
if (rb_gc_obj_slot_size(obj) >= rb_str_size_as_embedded(obj)) {
10618-
if (!STR_EMBED_P(obj) && rb_str_reembeddable_p(obj)) {
10619-
rb_str_make_embedded(obj);
10620-
}
10617+
#if USE_RVARGC
10618+
/* If, after move the string is not embedded, and can fit in the
10619+
* slot it's been placed in, then re-embed it. */
10620+
if (rb_gc_obj_slot_size(obj) >= rb_str_size_as_embedded(obj)) {
10621+
if (!STR_EMBED_P(obj) && rb_str_reembeddable_p(obj)) {
10622+
rb_str_make_embedded(obj);
1062110623
}
10622-
#endif
1062310624
}
10625+
#endif
1062410626

1062510627
break;
1062610628
}
@@ -11719,24 +11721,25 @@ get_envparam_double(const char *name, double *default_value, double lower_bound,
1171911721
}
1172011722

1172111723
static void
11722-
gc_set_initial_pages(void)
11724+
gc_set_initial_pages(rb_objspace_t *objspace)
1172311725
{
11724-
size_t min_pages;
11725-
rb_objspace_t *objspace = &rb_objspace;
11726-
1172711726
gc_rest(objspace);
1172811727

11729-
min_pages = gc_params.heap_init_slots / HEAP_PAGE_OBJ_LIMIT;
11730-
11731-
size_t pages_per_class = (min_pages - heap_eden_total_pages(objspace)) / SIZE_POOL_COUNT;
11732-
1173311728
for (int i = 0; i < SIZE_POOL_COUNT; i++) {
1173411729
rb_size_pool_t *size_pool = &size_pools[i];
1173511730

11736-
heap_add_pages(objspace, size_pool, SIZE_POOL_EDEN_HEAP(size_pool), pages_per_class);
11731+
if (gc_params.heap_init_slots > size_pool->eden_heap.total_slots) {
11732+
size_t slots = gc_params.heap_init_slots - size_pool->eden_heap.total_slots;
11733+
int multiple = size_pool->slot_size / BASE_SLOT_SIZE;
11734+
size_pool->allocatable_pages = slots * multiple / HEAP_PAGE_OBJ_LIMIT;
11735+
}
11736+
else {
11737+
/* We already have more slots than heap_init_slots allows, so
11738+
* prevent creating more pages. */
11739+
size_pool->allocatable_pages = 0;
11740+
}
1173711741
}
11738-
11739-
heap_add_pages(objspace, &size_pools[0], SIZE_POOL_EDEN_HEAP(&size_pools[0]), min_pages - heap_eden_total_pages(objspace));
11742+
heap_pages_expand_sorted(objspace);
1174011743
}
1174111744

1174211745
/*
@@ -11792,7 +11795,7 @@ ruby_gc_set_params(void)
1179211795

1179311796
/* RUBY_GC_HEAP_INIT_SLOTS */
1179411797
if (get_envparam_size("RUBY_GC_HEAP_INIT_SLOTS", &gc_params.heap_init_slots, 0)) {
11795-
gc_set_initial_pages();
11798+
gc_set_initial_pages(objspace);
1179611799
}
1179711800

1179811801
get_envparam_double("RUBY_GC_HEAP_GROWTH_FACTOR", &gc_params.growth_factor, 1.0, 0.0, FALSE);
@@ -12840,6 +12843,7 @@ wmap_free(void *ptr)
1284012843
st_foreach(w->obj2wmap, wmap_free_map, 0);
1284112844
st_free_table(w->obj2wmap);
1284212845
st_free_table(w->wmap2obj);
12846+
xfree(w);
1284312847
}
1284412848

1284512849
static int

include/ruby/internal/abi.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#if defined(HAVE_FUNC_WEAK) && !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
3232
# define RUBY_DLN_CHECK_ABI
3333
#endif
34+
#endif /* RUBY_ABI_VERSION */
3435

3536
#ifdef RUBY_DLN_CHECK_ABI
3637

@@ -41,7 +42,11 @@ extern "C" {
4142
RUBY_FUNC_EXPORTED unsigned long long __attribute__((weak))
4243
ruby_abi_version(void)
4344
{
45+
# ifdef RUBY_ABI_VERSION
4446
return RUBY_ABI_VERSION;
47+
# else
48+
return 0;
49+
# endif
4550
}
4651

4752
# ifdef __cplusplus
@@ -51,5 +56,3 @@ ruby_abi_version(void)
5156
#endif
5257

5358
#endif
54-
55-
#endif

0 commit comments

Comments
 (0)