1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

undefine alloc functions for C extensions

per guidance in doc/extension.rdoc, these classes now undefine their
alloc functions:

- ObjectSpace::InternalObjectWrapper
- Socket::Ifaddr
This commit is contained in:
Mike Dalessio 2021-05-28 02:50:37 -04:00 committed by Nobuyoshi Nakada
parent e8e3b7a0e2
commit c0f4e4ca6d
Notes: git 2021-08-20 08:30:34 +09:00
2 changed files with 2 additions and 0 deletions

View file

@ -998,6 +998,7 @@ Init_objspace(void)
* You can use the #type method to check the type of the internal object.
*/
rb_cInternalObjectWrapper = rb_define_class_under(rb_mObjSpace, "InternalObjectWrapper", rb_cObject);
rb_undef_alloc_func(rb_cInternalObjectWrapper);
rb_define_method(rb_cInternalObjectWrapper, "type", iow_type, 0);
rb_define_method(rb_cInternalObjectWrapper, "inspect", iow_inspect, 0);
rb_define_method(rb_cInternalObjectWrapper, "internal_object_id", iow_internal_object_id, 0);

View file

@ -460,6 +460,7 @@ rsock_init_sockifaddr(void)
* Socket::Ifaddr represents a result of getifaddrs() function.
*/
rb_cSockIfaddr = rb_define_class_under(rb_cSocket, "Ifaddr", rb_cObject);
rb_undef_alloc_func(rb_cSockIfaddr);
rb_define_method(rb_cSockIfaddr, "inspect", ifaddr_inspect, 0);
rb_define_method(rb_cSockIfaddr, "name", ifaddr_name, 0);
rb_define_method(rb_cSockIfaddr, "ifindex", ifaddr_ifindex, 0);