summaryrefslogtreecommitdiff
path: root/ext/pdo
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-09-27 18:00:48 +0000
committerDmitry Stogov <dmitry@php.net>2007-09-27 18:00:48 +0000
commit6c810b0d4c1b12c675f69f5cfb32f26b6179d460 (patch)
treee95f336ce39693101bed812985b914c9bd80523e /ext/pdo
parentf6d9901873156c560eb6da7dafbefc56c363b2bd (diff)
downloadphp-git-6c810b0d4c1b12c675f69f5cfb32f26b6179d460.tar.gz
Improved memory usage by movig constants to read only memory. (Dmitry, Pierre)
Diffstat (limited to 'ext/pdo')
-rwxr-xr-xext/pdo/pdo.c4
-rwxr-xr-xext/pdo/pdo_dbh.c8
-rwxr-xr-xext/pdo/pdo_stmt.c4
-rwxr-xr-xext/pdo/php_pdo_driver.h2
-rwxr-xr-xext/pdo/php_pdo_int.h6
5 files changed, 12 insertions, 12 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 43652a971e..cd25bb3a2a 100755
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -114,7 +114,7 @@ PHP_FUNCTION(pdo_drivers)
/* }}} */
/* {{{ pdo_functions[] */
-zend_function_entry pdo_functions[] = {
+const zend_function_entry pdo_functions[] = {
PHP_FE(pdo_drivers, NULL)
{NULL, NULL, NULL}
};
@@ -122,7 +122,7 @@ zend_function_entry pdo_functions[] = {
/* {{{ pdo_functions[] */
#if ZEND_MODULE_API_NO >= 20050922
-static zend_module_dep pdo_deps[] = {
+static const zend_module_dep pdo_deps[] = {
#ifdef HAVE_SPL
ZEND_MOD_REQUIRED("spl")
#endif
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index ff65aeb7f8..d1d83c0dc8 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -1160,7 +1160,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo_quote, 0, 0, 1)
ZEND_END_ARG_INFO()
/* }}} */
-zend_function_entry pdo_dbh_functions[] = {
+const zend_function_entry pdo_dbh_functions[] = {
ZEND_MALIAS(PDO, __construct, dbh_constructor, arginfo_pdo___construct, ZEND_ACC_PUBLIC)
PHP_ME(PDO, prepare, arginfo_pdo_prepare, ZEND_ACC_PUBLIC)
PHP_ME(PDO, beginTransaction, NULL, ZEND_ACC_PUBLIC)
@@ -1183,7 +1183,7 @@ zend_function_entry pdo_dbh_functions[] = {
/* {{{ overloaded object handlers for PDO class */
int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
{
- zend_function_entry *funcs;
+ const zend_function_entry *funcs;
zend_function func;
zend_internal_function *ifunc = (zend_internal_function*)&func;
int namelen;
@@ -1206,11 +1206,11 @@ int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
while (funcs->fname) {
ifunc->type = ZEND_INTERNAL_FUNCTION;
ifunc->handler = funcs->handler;
- ifunc->function_name = funcs->fname;
+ ifunc->function_name = (char*)funcs->fname;
ifunc->scope = dbh->ce;
ifunc->prototype = NULL;
if (funcs->arg_info) {
- ifunc->arg_info = funcs->arg_info + 1;
+ ifunc->arg_info = (zend_arg_info*)funcs->arg_info + 1;
ifunc->num_args = funcs->num_args;
if (funcs->arg_info[0].required_num_args == -1) {
ifunc->required_num_args = funcs->num_args;
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index ef86c7e1ac..693d03d690 100755
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2147,7 +2147,7 @@ static PHP_METHOD(PDOStatement, __sleep)
}
/* }}} */
-zend_function_entry pdo_dbstmt_functions[] = {
+const zend_function_entry pdo_dbstmt_functions[] = {
PHP_ME(PDOStatement, execute, arginfo_pdostatement_execute, ZEND_ACC_PUBLIC)
PHP_ME(PDOStatement, fetch, arginfo_pdostatement_fetch, ZEND_ACC_PUBLIC)
PHP_ME(PDOStatement, bindParam, arginfo_pdostatement_bindparam, ZEND_ACC_PUBLIC)
@@ -2520,7 +2520,7 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int
/* {{{ overloaded handlers for PDORow class (used by PDO_FETCH_LAZY) */
-zend_function_entry pdo_row_functions[] = {
+const zend_function_entry pdo_row_functions[] = {
{NULL, NULL, NULL}
};
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index c3c98c4301..78733b812b 100755
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -288,7 +288,7 @@ enum {
PDO_DBH_DRIVER_METHOD_KIND__MAX
};
-typedef zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind TSRMLS_DC);
+typedef const zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind TSRMLS_DC);
struct pdo_dbh_methods {
pdo_dbh_close_func closer;
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index c60d961626..7b83e55483 100755
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -32,12 +32,12 @@ void pdo_dbh_init(TSRMLS_D);
void pdo_stmt_init(TSRMLS_D);
extern zend_object_value pdo_dbh_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_function_entry pdo_dbh_functions[];
+extern const zend_function_entry pdo_dbh_functions[];
extern zend_class_entry *pdo_dbh_ce;
extern ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor);
extern zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_function_entry pdo_dbstmt_functions[];
+extern const zend_function_entry pdo_dbstmt_functions[];
extern zend_class_entry *pdo_dbstmt_ce;
void pdo_dbstmt_free_storage(pdo_stmt_t *stmt TSRMLS_DC);
zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
@@ -46,7 +46,7 @@ int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC);
int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip_first_arg);
extern zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_function_entry pdo_row_functions[];
+extern const zend_function_entry pdo_row_functions[];
extern zend_class_entry *pdo_row_ce;
void pdo_row_free_storage(pdo_stmt_t *stmt TSRMLS_DC);
extern zend_object_handlers pdo_row_object_handlers;