From 6c810b0d4c1b12c675f69f5cfb32f26b6179d460 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 27 Sep 2007 18:00:48 +0000 Subject: Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) --- ext/dom/attr.c | 2 +- ext/dom/cdatasection.c | 2 +- ext/dom/characterdata.c | 2 +- ext/dom/comment.c | 2 +- ext/dom/document.c | 2 +- ext/dom/documentfragment.c | 2 +- ext/dom/documenttype.c | 2 +- ext/dom/dom_fe.h | 60 +++++++++++++++++++-------------------- ext/dom/domconfiguration.c | 2 +- ext/dom/domerror.c | 2 +- ext/dom/domerrorhandler.c | 2 +- ext/dom/domexception.c | 2 +- ext/dom/domimplementation.c | 2 +- ext/dom/domimplementationlist.c | 2 +- ext/dom/domimplementationsource.c | 2 +- ext/dom/domlocator.c | 2 +- ext/dom/domstringlist.c | 2 +- ext/dom/element.c | 2 +- ext/dom/entity.c | 2 +- ext/dom/entityreference.c | 2 +- ext/dom/namednodemap.c | 2 +- ext/dom/namelist.c | 2 +- ext/dom/node.c | 2 +- ext/dom/nodelist.c | 2 +- ext/dom/notation.c | 2 +- ext/dom/php_dom.c | 4 +-- ext/dom/processinginstruction.c | 2 +- ext/dom/string_extend.c | 2 +- ext/dom/text.c | 2 +- ext/dom/typeinfo.c | 2 +- ext/dom/userdatahandler.c | 2 +- ext/dom/xpath.c | 2 +- 32 files changed, 62 insertions(+), 62 deletions(-) (limited to 'ext/dom') diff --git a/ext/dom/attr.c b/ext/dom/attr.c index ce7b030c09..8a8c8f9c0e 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -37,7 +37,7 @@ * Since: */ -zend_function_entry php_dom_attr_class_functions[] = { +const zend_function_entry php_dom_attr_class_functions[] = { PHP_FALIAS(isId, dom_attr_is_id, NULL) PHP_ME(domattr, __construct, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index 3c2f302d8c..1f74ba75dc 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_cdatasection_class_functions[] = { +const zend_function_entry php_dom_cdatasection_class_functions[] = { PHP_ME(domcdatasection, __construct, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c index 117ada7528..60a3fc3019 100644 --- a/ext/dom/characterdata.c +++ b/ext/dom/characterdata.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_characterdata_class_functions[] = { +const zend_function_entry php_dom_characterdata_class_functions[] = { PHP_FALIAS(substringData, dom_characterdata_substring_data, NULL) PHP_FALIAS(appendData, dom_characterdata_append_data, NULL) PHP_FALIAS(insertData, dom_characterdata_insert_data, NULL) diff --git a/ext/dom/comment.c b/ext/dom/comment.c index f5ecb4082e..101b496f41 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_comment_class_functions[] = { +const zend_function_entry php_dom_comment_class_functions[] = { PHP_ME(domcomment, __construct, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; diff --git a/ext/dom/document.c b/ext/dom/document.c index f726da0e14..894cdcf928 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -48,7 +48,7 @@ struct _idsIterator { * Since: */ -zend_function_entry php_dom_document_class_functions[] = { +const zend_function_entry php_dom_document_class_functions[] = { PHP_FALIAS(createElement, dom_document_create_element, NULL) PHP_FALIAS(createDocumentFragment, dom_document_create_document_fragment, NULL) PHP_FALIAS(createTextNode, dom_document_create_text_node, NULL) diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index 58b8e024e8..3751bc69e6 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_documentfragment_class_functions[] = { +const zend_function_entry php_dom_documentfragment_class_functions[] = { PHP_ME(domdocumentfragment, __construct, NULL, ZEND_ACC_PUBLIC) PHP_ME(domdocumentfragment, appendXML, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c index ffeda243a4..196d4ed343 100644 --- a/ext/dom/documenttype.c +++ b/ext/dom/documenttype.c @@ -34,7 +34,7 @@ * Since: */ -zend_function_entry php_dom_documenttype_class_functions[] = { +const zend_function_entry php_dom_documenttype_class_functions[] = { {NULL, NULL, NULL} }; diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h index f1e477035c..6d3815b673 100644 --- a/ext/dom/dom_fe.h +++ b/ext/dom/dom_fe.h @@ -21,36 +21,36 @@ #ifndef DOM_FE_H #define DOM_FE_H -extern zend_function_entry php_dom_domexception_class_functions[]; -extern zend_function_entry php_dom_domstringlist_class_functions[]; -extern zend_function_entry php_dom_namelist_class_functions[]; -extern zend_function_entry php_dom_domimplementationlist_class_functions[]; -extern zend_function_entry php_dom_domimplementationsource_class_functions[]; -extern zend_function_entry php_dom_domimplementation_class_functions[]; -extern zend_function_entry php_dom_documentfragment_class_functions[]; -extern zend_function_entry php_dom_document_class_functions[]; -extern zend_function_entry php_dom_node_class_functions[]; -extern zend_function_entry php_dom_nodelist_class_functions[]; -extern zend_function_entry php_dom_namednodemap_class_functions[]; -extern zend_function_entry php_dom_characterdata_class_functions[]; -extern zend_function_entry php_dom_attr_class_functions[]; -extern zend_function_entry php_dom_element_class_functions[]; -extern zend_function_entry php_dom_text_class_functions[]; -extern zend_function_entry php_dom_comment_class_functions[]; -extern zend_function_entry php_dom_typeinfo_class_functions[]; -extern zend_function_entry php_dom_userdatahandler_class_functions[]; -extern zend_function_entry php_dom_domerror_class_functions[]; -extern zend_function_entry php_dom_domerrorhandler_class_functions[]; -extern zend_function_entry php_dom_domlocator_class_functions[]; -extern zend_function_entry php_dom_domconfiguration_class_functions[]; -extern zend_function_entry php_dom_cdatasection_class_functions[]; -extern zend_function_entry php_dom_documenttype_class_functions[]; -extern zend_function_entry php_dom_notation_class_functions[]; -extern zend_function_entry php_dom_entity_class_functions[]; -extern zend_function_entry php_dom_entityreference_class_functions[]; -extern zend_function_entry php_dom_processinginstruction_class_functions[]; -extern zend_function_entry php_dom_string_extend_class_functions[]; -extern zend_function_entry php_dom_xpath_class_functions[]; +extern const zend_function_entry php_dom_domexception_class_functions[]; +extern const zend_function_entry php_dom_domstringlist_class_functions[]; +extern const zend_function_entry php_dom_namelist_class_functions[]; +extern const zend_function_entry php_dom_domimplementationlist_class_functions[]; +extern const zend_function_entry php_dom_domimplementationsource_class_functions[]; +extern const zend_function_entry php_dom_domimplementation_class_functions[]; +extern const zend_function_entry php_dom_documentfragment_class_functions[]; +extern const zend_function_entry php_dom_document_class_functions[]; +extern const zend_function_entry php_dom_node_class_functions[]; +extern const zend_function_entry php_dom_nodelist_class_functions[]; +extern const zend_function_entry php_dom_namednodemap_class_functions[]; +extern const zend_function_entry php_dom_characterdata_class_functions[]; +extern const zend_function_entry php_dom_attr_class_functions[]; +extern const zend_function_entry php_dom_element_class_functions[]; +extern const zend_function_entry php_dom_text_class_functions[]; +extern const zend_function_entry php_dom_comment_class_functions[]; +extern const zend_function_entry php_dom_typeinfo_class_functions[]; +extern const zend_function_entry php_dom_userdatahandler_class_functions[]; +extern const zend_function_entry php_dom_domerror_class_functions[]; +extern const zend_function_entry php_dom_domerrorhandler_class_functions[]; +extern const zend_function_entry php_dom_domlocator_class_functions[]; +extern const zend_function_entry php_dom_domconfiguration_class_functions[]; +extern const zend_function_entry php_dom_cdatasection_class_functions[]; +extern const zend_function_entry php_dom_documenttype_class_functions[]; +extern const zend_function_entry php_dom_notation_class_functions[]; +extern const zend_function_entry php_dom_entity_class_functions[]; +extern const zend_function_entry php_dom_entityreference_class_functions[]; +extern const zend_function_entry php_dom_processinginstruction_class_functions[]; +extern const zend_function_entry php_dom_string_extend_class_functions[]; +extern const zend_function_entry php_dom_xpath_class_functions[]; /* domexception errors */ typedef enum { diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c index c1cf0f3312..785b09226c 100644 --- a/ext/dom/domconfiguration.c +++ b/ext/dom/domconfiguration.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_domconfiguration_class_functions[] = { +const zend_function_entry php_dom_domconfiguration_class_functions[] = { PHP_FALIAS(setParameter, dom_domconfiguration_set_parameter, NULL) PHP_FALIAS(getParameter, dom_domconfiguration_get_parameter, NULL) PHP_FALIAS(canSetParameter, dom_domconfiguration_can_set_parameter, NULL) diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c index 8bce0cda4a..68e3c07c17 100644 --- a/ext/dom/domerror.c +++ b/ext/dom/domerror.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_domerror_class_functions[] = { +const zend_function_entry php_dom_domerror_class_functions[] = { {NULL, NULL, NULL} }; diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c index ad40162eff..449895aa4c 100644 --- a/ext/dom/domerrorhandler.c +++ b/ext/dom/domerrorhandler.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_domerrorhandler_class_functions[] = { +const zend_function_entry php_dom_domerrorhandler_class_functions[] = { PHP_FALIAS(handleError, dom_domerrorhandler_handle_error, NULL) {NULL, NULL, NULL} }; diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c index 42aa341ada..9a65f51259 100644 --- a/ext/dom/domexception.c +++ b/ext/dom/domexception.c @@ -37,7 +37,7 @@ extern zend_class_entry *dom_domexception_class_entry; -zend_function_entry php_dom_domexception_class_functions[] = { +const zend_function_entry php_dom_domexception_class_functions[] = { {NULL, NULL, NULL} }; diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index de92cb0489..bd48659be1 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -34,7 +34,7 @@ * Since: */ -zend_function_entry php_dom_domimplementation_class_functions[] = { +const zend_function_entry php_dom_domimplementation_class_functions[] = { PHP_ME(domimplementation, getFeature, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) PHP_ME(domimplementation, hasFeature, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) PHP_ME(domimplementation, createDocumentType, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c index 7d9ed84b47..db4f4c503b 100644 --- a/ext/dom/domimplementationlist.c +++ b/ext/dom/domimplementationlist.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_domimplementationlist_class_functions[] = { +const zend_function_entry php_dom_domimplementationlist_class_functions[] = { PHP_FALIAS(item, dom_domimplementationlist_item, NULL) {NULL, NULL, NULL} }; diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c index 7e5e488d47..f1be6c5e55 100644 --- a/ext/dom/domimplementationsource.c +++ b/ext/dom/domimplementationsource.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_domimplementationsource_class_functions[] = { +const zend_function_entry php_dom_domimplementationsource_class_functions[] = { PHP_FALIAS(getDomimplementation, dom_domimplementationsource_get_domimplementation, NULL) PHP_FALIAS(getDomimplementations, dom_domimplementationsource_get_domimplementations, NULL) {NULL, NULL, NULL} diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c index c98067106c..ae3b795b8d 100644 --- a/ext/dom/domlocator.c +++ b/ext/dom/domlocator.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_domlocator_class_functions[] = { +const zend_function_entry php_dom_domlocator_class_functions[] = { {NULL, NULL, NULL} }; diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c index 6372e0c703..723445a675 100644 --- a/ext/dom/domstringlist.c +++ b/ext/dom/domstringlist.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_domstringlist_class_functions[] = { +const zend_function_entry php_dom_domstringlist_class_functions[] = { PHP_FALIAS(item, dom_domstringlist_item, NULL) {NULL, NULL, NULL} }; diff --git a/ext/dom/element.c b/ext/dom/element.c index fae0dae1c6..a42b5b16b1 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_element_class_functions[] = { +const zend_function_entry php_dom_element_class_functions[] = { PHP_FALIAS(getAttribute, dom_element_get_attribute, NULL) PHP_FALIAS(setAttribute, dom_element_set_attribute, NULL) PHP_FALIAS(removeAttribute, dom_element_remove_attribute, NULL) diff --git a/ext/dom/entity.c b/ext/dom/entity.c index 50dca0d472..a40280d506 100644 --- a/ext/dom/entity.c +++ b/ext/dom/entity.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_entity_class_functions[] = { +const zend_function_entry php_dom_entity_class_functions[] = { {NULL, NULL, NULL} }; diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index f80af0f917..d0f0b18a60 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_entityreference_class_functions[] = { +const zend_function_entry php_dom_entityreference_class_functions[] = { PHP_ME(domentityreference, __construct, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index 6d76f31c97..8cc431fd07 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_namednodemap_class_functions[] = { +const zend_function_entry php_dom_namednodemap_class_functions[] = { PHP_FALIAS(getNamedItem, dom_namednodemap_get_named_item, NULL) PHP_FALIAS(setNamedItem, dom_namednodemap_set_named_item, NULL) PHP_FALIAS(removeNamedItem, dom_namednodemap_remove_named_item, NULL) diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c index 6ff06f64ed..0f2862ebcb 100644 --- a/ext/dom/namelist.c +++ b/ext/dom/namelist.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_namelist_class_functions[] = { +const zend_function_entry php_dom_namelist_class_functions[] = { PHP_FALIAS(getName, dom_namelist_get_name, NULL) PHP_FALIAS(getNamespaceURI, dom_namelist_get_namespace_uri, NULL) {NULL, NULL, NULL} diff --git a/ext/dom/node.c b/ext/dom/node.c index e95fa2c9d1..cd5ce8cf3b 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -34,7 +34,7 @@ * Since: */ -zend_function_entry php_dom_node_class_functions[] = { +const zend_function_entry php_dom_node_class_functions[] = { PHP_FALIAS(insertBefore, dom_node_insert_before, NULL) PHP_FALIAS(replaceChild, dom_node_replace_child, NULL) PHP_FALIAS(removeChild, dom_node_remove_child, NULL) diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index bcd015561a..d985869505 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_nodelist_class_functions[] = { +const zend_function_entry php_dom_nodelist_class_functions[] = { PHP_FALIAS(item, dom_nodelist_item, NULL) {NULL, NULL, NULL} }; diff --git a/ext/dom/notation.c b/ext/dom/notation.c index 57f2424f2e..c03f2461aa 100644 --- a/ext/dom/notation.c +++ b/ext/dom/notation.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_notation_class_functions[] = { +const zend_function_entry php_dom_notation_class_functions[] = { {NULL, NULL, NULL} }; diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index d6922c334a..31e494b585 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -512,7 +512,7 @@ zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC) return zobject->value.obj; } -static zend_function_entry dom_functions[] = { +static const zend_function_entry dom_functions[] = { PHP_FE(dom_import_simplexml, NULL) {NULL, NULL, NULL} }; @@ -525,7 +525,7 @@ static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) { } } -static zend_module_dep dom_deps[] = { +static const zend_module_dep dom_deps[] = { ZEND_MOD_REQUIRED("libxml") ZEND_MOD_CONFLICTS("domxml") {NULL, NULL, NULL} diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index c1119b848a..a30fae82ea 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_processinginstruction_class_functions[] = { +const zend_function_entry php_dom_processinginstruction_class_functions[] = { PHP_ME(domprocessinginstruction, __construct, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c index f828b1eff2..d7f64952fd 100644 --- a/ext/dom/string_extend.c +++ b/ext/dom/string_extend.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_string_extend_class_functions[] = { +const zend_function_entry php_dom_string_extend_class_functions[] = { PHP_FALIAS(findOffset16, dom_string_extend_find_offset16, NULL) PHP_FALIAS(findOffset32, dom_string_extend_find_offset32, NULL) {NULL, NULL, NULL} diff --git a/ext/dom/text.c b/ext/dom/text.c index da7b34af1e..b23f94a576 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -35,7 +35,7 @@ * Since: */ -zend_function_entry php_dom_text_class_functions[] = { +const zend_function_entry php_dom_text_class_functions[] = { PHP_FALIAS(splitText, dom_text_split_text, NULL) PHP_FALIAS(isWhitespaceInElementContent, dom_text_is_whitespace_in_element_content, NULL) PHP_FALIAS(isElementContentWhitespace, dom_text_is_whitespace_in_element_content, NULL) diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c index 338e58dd28..f8c3ce8db0 100644 --- a/ext/dom/typeinfo.c +++ b/ext/dom/typeinfo.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_typeinfo_class_functions[] = { +const zend_function_entry php_dom_typeinfo_class_functions[] = { {NULL, NULL, NULL} }; diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c index 908434ffd3..4df36da623 100644 --- a/ext/dom/userdatahandler.c +++ b/ext/dom/userdatahandler.c @@ -35,7 +35,7 @@ * Since: DOM Level 3 */ -zend_function_entry php_dom_userdatahandler_class_functions[] = { +const zend_function_entry php_dom_userdatahandler_class_functions[] = { PHP_FALIAS(handle, dom_userdatahandler_handle, NULL) {NULL, NULL, NULL} }; diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index c7522a119d..339fe5a879 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -36,7 +36,7 @@ #if defined(LIBXML_XPATH_ENABLED) -zend_function_entry php_dom_xpath_class_functions[] = { +const zend_function_entry php_dom_xpath_class_functions[] = { PHP_ME(domxpath, __construct, NULL, ZEND_ACC_PUBLIC) PHP_FALIAS(registerNamespace, dom_xpath_register_ns, NULL) PHP_FALIAS(query, dom_xpath_query, NULL) -- cgit v1.2.1