From 5e8977bd626105fb45b54d9d65ef48a31d5e15ec Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 12 Jul 2018 17:09:40 +0300 Subject: [PATCH] Merge zend_class_entry.create_object and zend_class_entry.interface_gets_implemented into the same memory lacation. The first used only by classes, the second only by magic interfaces. --- Zend/zend.h | 6 ++++-- Zend/zend_API.h | 1 - Zend/zend_compile.c | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index 4f33dd89cc..0d19331bd1 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -143,9 +143,11 @@ struct _zend_class_entry { zend_class_iterator_funcs *iterator_funcs_ptr; /* handlers */ - zend_object* (*create_object)(zend_class_entry *class_type); + union { + zend_object* (*create_object)(zend_class_entry *class_type); + int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */ + }; zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref); - int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */ union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method); /* serializer callbacks */ diff --git a/Zend/zend_API.h b/Zend/zend_API.h index d450c4dd21..3bd2471dda 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -202,7 +202,6 @@ typedef struct _zend_fcall_info_cache { class_container.serialize = NULL; \ class_container.unserialize = NULL; \ class_container.create_object = NULL; \ - class_container.interface_gets_implemented = NULL; \ class_container.get_static_method = NULL; \ class_container.__call = NULL; \ class_container.__callstatic = NULL; \ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index e0a7acf12a..16b8fe9288 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1751,7 +1751,6 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify ce->create_object = NULL; ce->get_iterator = NULL; ce->iterator_funcs_ptr = NULL; - ce->interface_gets_implemented = NULL; ce->get_static_method = NULL; ce->parent = NULL; ce->num_interfaces = 0; -- 2.49.0