From 9e70d7672dd646b8c9b29ccc452e4dc5aa015437 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 4 Feb 2015 15:24:13 +0300 Subject: Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. --- ext/dom/php_dom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/dom/php_dom.c') diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 6797e894b5..b6b66fc507 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1081,7 +1081,7 @@ void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xml static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy) /* {{{ */ { - dom_object *intern = ecalloc(1, sizeof(dom_object) + sizeof(zval) * (class_type->default_properties_count - 1)); + dom_object *intern = ecalloc(1, sizeof(dom_object) + zend_object_properties_size(class_type)); zend_class_entry *base_class = class_type; while (base_class->type != ZEND_INTERNAL_CLASS && base_class->parent != NULL) { @@ -1112,7 +1112,7 @@ zend_object *dom_objects_new(zend_class_entry *class_type) /* {{{ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type) */ zend_object *dom_xpath_objects_new(zend_class_entry *class_type) { - dom_xpath_object *intern = ecalloc(1, sizeof(dom_xpath_object) + sizeof(zval) * (class_type->default_properties_count - 1)); + dom_xpath_object *intern = ecalloc(1, sizeof(dom_xpath_object) + zend_object_properties_size(class_type)); ALLOC_HASHTABLE(intern->registered_phpfunctions); zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0); -- cgit v1.2.1