diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-03-06 21:54:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-06 21:54:36 +0100 |
commit | b10b794cb143b54ce7dad04509349d331ae85162 (patch) | |
tree | 31bac49b2447b561394645aaa44ac727bd9ee7b3 | |
parent | c5cd42e6b38fcd6c0fc53505fde3a6ec6ad51685 (diff) | |
parent | 9214e69eb44e6d250bf500b9a7a530bdb0e0506e (diff) | |
download | ffi-b10b794cb143b54ce7dad04509349d331ae85162.tar.gz |
Merge pull request #1013 from larskanis/undef-abstractmem-new
Remove allocator of AbstractMemory
-rw-r--r-- | ext/ffi_c/AbstractMemory.c | 13 |
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 */ |