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/sqlite/sqlite.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/sqlite/sqlite.c') diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index cbf80a290e..6ead6c0302 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -164,7 +164,7 @@ static int php_sqlite_fetch(struct php_sqlite_result *rres TSRMLS_DC); enum { PHPSQLITE_ASSOC = 1, PHPSQLITE_NUM = 2, PHPSQLITE_BOTH = PHPSQLITE_ASSOC|PHPSQLITE_NUM }; -zend_function_entry sqlite_functions[] = { +const zend_function_entry sqlite_functions[] = { PHP_FE(sqlite_open, third_arg_force_ref) PHP_FE(sqlite_popen, third_arg_force_ref) PHP_FE(sqlite_close, NULL) @@ -207,7 +207,7 @@ zend_function_entry sqlite_functions[] = { {NULL, NULL, NULL} }; -zend_function_entry sqlite_funcs_db[] = { +const zend_function_entry sqlite_funcs_db[] = { PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref, 0) /* PHP_ME_MAPPING(close, sqlite_close, NULL, 0)*/ PHP_ME_MAPPING(query, sqlite_query, third_arg_force_ref, 0) @@ -227,7 +227,7 @@ zend_function_entry sqlite_funcs_db[] = { {NULL, NULL, NULL} }; -zend_function_entry sqlite_funcs_query[] = { +const zend_function_entry sqlite_funcs_query[] = { PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL, 0) PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL, 0) PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL, 0) @@ -251,7 +251,7 @@ zend_function_entry sqlite_funcs_query[] = { {NULL, NULL, NULL} }; -zend_function_entry sqlite_funcs_ub_query[] = { +const zend_function_entry sqlite_funcs_ub_query[] = { PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL, 0) PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL, 0) PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL, 0) @@ -266,12 +266,12 @@ zend_function_entry sqlite_funcs_ub_query[] = { {NULL, NULL, NULL} }; -zend_function_entry sqlite_funcs_exception[] = { +const zend_function_entry sqlite_funcs_exception[] = { {NULL, NULL, NULL} }; /* Dependancies */ -static zend_module_dep sqlite_deps[] = { +static const zend_module_dep sqlite_deps[] = { #if defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1)) ZEND_MOD_REQUIRED("spl") #endif -- cgit v1.2.1