summaryrefslogtreecommitdiff
path: root/ext/ffi_c/MemoryPointer.c
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2023-05-08 13:21:33 +0200
committerLars Kanis <lars@greiz-reinsdorf.de>2023-05-08 13:21:33 +0200
commitc6b7139d0394638ef51b451b81dcd2ffefb94160 (patch)
treef1513b0afc5ef798382100a53c3191ff52e66d3e /ext/ffi_c/MemoryPointer.c
parentc1e6a14476e210efeac79aa260c2eb2d1d98a580 (diff)
parent938b5d8590361acf871fddb9149fe725f65d781f (diff)
downloadffi-c6b7139d0394638ef51b451b81dcd2ffefb94160.tar.gz
Merge branch 'ractor'
Diffstat (limited to 'ext/ffi_c/MemoryPointer.c')
-rw-r--r--ext/ffi_c/MemoryPointer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/ffi_c/MemoryPointer.c b/ext/ffi_c/MemoryPointer.c
index 8227183..a60168e 100644
--- a/ext/ffi_c/MemoryPointer.c
+++ b/ext/ffi_c/MemoryPointer.c
@@ -64,7 +64,7 @@ static const rb_data_type_t memory_pointer_data_type = {
.parent = &rbffi_pointer_data_type,
// IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE()
// macro to update VALUE references, as to trigger write barriers.
- .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | FFI_RUBY_TYPED_FROZEN_SHAREABLE
};
static VALUE
@@ -136,6 +136,7 @@ memptr_free(VALUE self)
{
Pointer* ptr;
+ rb_check_frozen(self);
TypedData_Get_Struct(self, Pointer, &memory_pointer_data_type, ptr);
if (ptr->allocated) {