summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2023-03-06 21:06:58 +0100
committerLars Kanis <lars@greiz-reinsdorf.de>2023-03-06 21:07:47 +0100
commit9214e69eb44e6d250bf500b9a7a530bdb0e0506e (patch)
tree59274d3976aa4ee57cd21c772fd1cc1040e3a7a0
parentd54ea5a985425d163860b9723ed9e93a82aac2c5 (diff)
downloadffi-9214e69eb44e6d250bf500b9a7a530bdb0e0506e.tar.gz
Remove allocator of AbstractMemory
This disables AbstractMemory.new, which has no practical use. As discussed in #1010
-rw-r--r--ext/ffi_c/AbstractMemory.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/ext/ffi_c/AbstractMemory.c b/ext/ffi_c/AbstractMemory.c
index f7fb295..5f09b9e 100644
--- a/ext/ffi_c/AbstractMemory.c
+++ b/ext/ffi_c/AbstractMemory.c
@@ -73,17 +73,6 @@ const rb_data_type_t rbffi_abstract_memory_data_type = { /* extern */
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
};
-static VALUE
-memory_allocate(VALUE klass)
-{
- AbstractMemory* memory;
- VALUE obj;
- obj = TypedData_Make_Struct(klass, AbstractMemory, &rbffi_abstract_memory_data_type, memory);
- memory->flags = MEM_RD | MEM_WR;
-
- return obj;
-}
-
static size_t
memsize(const void *data)
{
@@ -803,7 +792,7 @@ rbffi_AbstractMemory_Init(VALUE moduleFFI)
* Document-variable: FFI::AbstractMemory
*/
rb_global_variable(&rbffi_AbstractMemoryClass);
- rb_define_alloc_func(classMemory, memory_allocate);
+ rb_undef_alloc_func(classMemory);
NullPointerErrorClass = rb_define_class_under(moduleFFI, "NullPointerError", rb_eRuntimeError);
/* Document-variable: NullPointerError */