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
2 changes: 1 addition & 1 deletion box.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ box_entry_free(void *ptr)
cleanup_all_local_extensions(box->ruby_dln_libmap);

box_root_free(ptr);
xfree(ptr);
SIZED_FREE(box);
}

static size_t
Expand Down
2 changes: 1 addition & 1 deletion marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,7 @@ r_object(struct load_arg *arg)
static void
clear_load_arg(struct load_arg *arg)
{
xfree(arg->buf);
ruby_sized_xfree(arg->buf, BUFSIZ);
arg->buf = NULL;
arg->buflen = 0;
arg->offset = 0;
Expand Down
4 changes: 2 additions & 2 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ update_char_offset(VALUE match)
num_regs = rm->regs.num_regs;

if (rm->char_offset_num_allocated < num_regs) {
REALLOC_N(rm->char_offset, struct rmatch_offset, num_regs);
SIZED_REALLOC_N(rm->char_offset, struct rmatch_offset, num_regs, rm->char_offset_num_allocated);
rm->char_offset_num_allocated = num_regs;
}

Expand Down Expand Up @@ -1101,7 +1101,7 @@ match_init_copy(VALUE obj, VALUE orig)

if (RMATCH_EXT(orig)->char_offset_num_allocated) {
if (rm->char_offset_num_allocated < rm->regs.num_regs) {
REALLOC_N(rm->char_offset, struct rmatch_offset, rm->regs.num_regs);
SIZED_REALLOC_N(rm->char_offset, struct rmatch_offset, rm->regs.num_regs, rm->char_offset_num_allocated);
rm->char_offset_num_allocated = rm->regs.num_regs;
}
MEMCPY(rm->char_offset, RMATCH_EXT(orig)->char_offset,
Expand Down
19 changes: 3 additions & 16 deletions scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ struct rb_fiber_scheduler_blocking_operation {
volatile rb_atomic_t status;
};

static void
blocking_operation_mark(void *ptr)
{
// No Ruby objects to mark in our struct
}

static void
blocking_operation_free(void *ptr)
{
rb_fiber_scheduler_blocking_operation_t *blocking_operation = (rb_fiber_scheduler_blocking_operation_t *)ptr;
ruby_xfree(blocking_operation);
}

static size_t
blocking_operation_memsize(const void *ptr)
{
Expand All @@ -99,11 +86,11 @@ blocking_operation_memsize(const void *ptr)
static const rb_data_type_t blocking_operation_data_type = {
"Fiber::Scheduler::BlockingOperation",
{
blocking_operation_mark,
blocking_operation_free,
NULL, // nothing to mark
RUBY_DEFAULT_FREE,
blocking_operation_memsize,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_EMBEDDABLE
};

/*
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
rb-sys = "0.9.123"
rb-sys = "0.9.124"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
rb-sys = "0.9.123"
rb-sys = "0.9.124"
2 changes: 1 addition & 1 deletion variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ rb_ensure_iv_list_size(VALUE obj, uint32_t current_len, uint32_t new_capacity)
RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));

if (FL_TEST_RAW(obj, ROBJECT_HEAP)) {
REALLOC_N(ROBJECT(obj)->as.heap.fields, VALUE, new_capacity);
SIZED_REALLOC_N(ROBJECT(obj)->as.heap.fields, VALUE, new_capacity, current_len);
}
else {
VALUE *ptr = ROBJECT_FIELDS(obj);
Expand Down