Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions ext/-test-/st/foreach/foreach.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ force_unpack_check(struct checker *c, st_data_t key, st_data_t val)
if (c->nr == 0) {
st_data_t i;

if (c->tbl->bins != NULL) rb_bug("should be packed");

/* force unpacking during iteration: */
for (i = 1; i < expect_size; i++)
st_add_direct(c->tbl, i, i);

if (c->tbl->bins == NULL) rb_bug("should be unpacked");
}

if (key != c->nr) {
Expand Down Expand Up @@ -84,8 +80,6 @@ unp_fec(VALUE self, VALUE test)

st_add_direct(tbl, 0, 0);

if (tbl->bins != NULL) rb_bug("should still be packed");

st_foreach_check(tbl, unp_fec_i, (st_data_t)&c, -1);

if (c.test == ID2SYM(rb_intern("delete2"))) {
Expand All @@ -98,8 +92,6 @@ unp_fec(VALUE self, VALUE test)
(VALUE)c.nr, (VALUE)expect_size);
}

if (tbl->bins == NULL) rb_bug("should be unpacked");

st_free_table(tbl);

return Qnil;
Expand Down Expand Up @@ -145,8 +137,6 @@ unp_fe(VALUE self, VALUE test)

st_add_direct(tbl, 0, 0);

if (tbl->bins != NULL) rb_bug("should still be packed");

st_foreach(tbl, unp_fe_i, (st_data_t)&c);

if (c.test == ID2SYM(rb_intern("unpack_delete"))) {
Expand All @@ -159,8 +149,6 @@ unp_fe(VALUE self, VALUE test)
(VALUE)c.nr, (VALUE)expect_size);
}

if (tbl->bins == NULL) rb_bug("should be unpacked");

st_free_table(tbl);

return Qnil;
Expand Down
23 changes: 4 additions & 19 deletions gc/mmtk/mmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,6 @@
#include <sys/sysctl.h>
#endif

#ifndef VM_CHECK_MODE
# define VM_CHECK_MODE RUBY_DEBUG
#endif

// From ractor_core.h
#ifndef RACTOR_CHECK_MODE
# define RACTOR_CHECK_MODE (VM_CHECK_MODE || RUBY_DEBUG) && (SIZEOF_UINT64_T == SIZEOF_VALUE)
#endif

#if RACTOR_CHECK_MODE
# define RVALUE_SUFFIX_SIZE sizeof(VALUE)
#else
# define RVALUE_SUFFIX_SIZE 0
#endif

struct objspace {
bool measure_gc_time;
bool gc_stress;
Expand Down Expand Up @@ -575,7 +560,7 @@ rb_gc_impl_objspace_alloc(void)
{
MMTk_Builder *builder = rb_mmtk_builder_init();
MMTk_RubyBindingOptions binding_options = {
.suffix_size = RVALUE_SUFFIX_SIZE,
.suffix_size = RB_GC_OBJ_SUFFIX_SIZE,
};
mmtk_init_binding(builder, &binding_options, &ruby_upcalls);

Expand Down Expand Up @@ -913,16 +898,16 @@ rb_gc_impl_new_obj(void *objspace_ptr, void *cache_ptr, VALUE klass, VALUE flags
mmtk_handle_user_collection_request(ractor_cache, false, false);
}

// Layout: [hidden size header (sizeof(VALUE))][payload (alloc_size)][suffix (RVALUE_SUFFIX_SIZE)]
alloc_size += sizeof(VALUE) + RVALUE_SUFFIX_SIZE;
// Layout: [hidden size header (sizeof(VALUE))][payload (alloc_size)][suffix (RB_GC_OBJ_SUFFIX_SIZE)]
alloc_size += sizeof(VALUE) + RB_GC_OBJ_SUFFIX_SIZE;

VALUE *alloc_obj = (VALUE *)rb_mmtk_alloc_fast_path(objspace, ractor_cache, alloc_size, MMTk_MIN_OBJ_ALIGN);
if (!alloc_obj) {
alloc_obj = mmtk_alloc(ractor_cache->mutator, alloc_size, MMTk_MIN_OBJ_ALIGN, 0, MMTK_ALLOCATION_SEMANTICS_DEFAULT);
}

alloc_obj++;
alloc_obj[-1] = alloc_size - sizeof(VALUE) - RVALUE_SUFFIX_SIZE;
alloc_obj[-1] = alloc_size - sizeof(VALUE) - RB_GC_OBJ_SUFFIX_SIZE;
alloc_obj[0] = flags;
alloc_obj[1] = klass;

Expand Down
5 changes: 2 additions & 3 deletions include/ruby/st.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ struct st_table {
const struct st_hash_type *type;
/* Number of entries currently in the table. */
st_index_t num_entries;
/* Array of bins used for access by keys. */
st_index_t *bins;
/* Start and bound index of entries in array entries.
entries_starts and entries_bound are in interval
[0,allocated_entries]. */
st_index_t entries_start, entries_bound;
/* Array of size 2^entry_power. */
/* Array of size 2^entry_power.
Optionnally followed by an array of bins used for access by keys. */
st_table_entry *entries;
};

Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/commands/fetch_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def check_version # :nodoc:
if options[:version] != Gem::Requirement.default &&
get_all_gem_names.size > 1
alert_error "Can't use --version with multiple gems. You can specify multiple gems with" \
" version requirements using `gem fetch 'my_gem:1.0.0' 'my_other_gem:~>2.0.0'`"
" version requirements using `gem fetch 'my_gem:1.0.0' 'my_other_gem:>=2'`"
terminate_interaction 1
end
end
Expand Down
4 changes: 3 additions & 1 deletion lib/rubygems/commands/help_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class Gem::Commands::HelpCommand < Gem::Command

To depend on a specific set of versions:

gem 'rake', '~> 10.3', '>= 10.3.2'
gem 'rake', '>= 10.3.2'
# or for multiple version restrictions
gem 'rake', '>= 10.3.2', "< 13"

RubyGems will require the gem name when activating the gem using
the RUBYGEMS_GEMDEPS environment variable or Gem::use_gemdeps. Use the
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/commands/install_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def check_version # :nodoc:
if options[:version] != Gem::Requirement.default &&
get_all_gem_names.size > 1
alert_error "Can't use --version with multiple gems. You can specify multiple gems with" \
" version requirements using `gem install 'my_gem:1.0.0' 'my_other_gem:~>2.0.0'`"
" version requirements using `gem install 'my_gem:1.0.0' 'my_other_gem:>=2'`"
terminate_interaction 1
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/commands/uninstall_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def check_version # :nodoc:
if options[:version] != Gem::Requirement.default &&
get_all_gem_names.size > 1
alert_error "Can't use --version with multiple gems. You can specify multiple gems with" \
" version requirements using `gem uninstall 'my_gem:1.0.0' 'my_other_gem:~>2.0.0'`"
" version requirements using `gem uninstall 'my_gem:1.0.0' 'my_other_gem:>=2'`"
terminate_interaction 1
end
end
Expand Down
5 changes: 2 additions & 3 deletions parser_st.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ struct parser_st_table {
const struct parser_st_hash_type *type;
/* Number of entries currently in the table. */
parser_st_index_t num_entries;
/* Array of bins used for access by keys. */
parser_st_index_t *bins;
/* Start and bound index of entries in array entries.
entries_starts and entries_bound are in interval
[0,allocated_entries]. */
parser_st_index_t entries_start, entries_bound;
/* Array of size 2^entry_power. */
/* Array of size 2^entry_power.
Optionnally followed by an array of bins used for access by keys. */
parser_st_table_entry *entries;
};

Expand Down
Loading