com php-src: correct fix for ext/opcache regarding zend_size _t replacements: ext/opcache/ZendAccelerator.c ext/ opcache/ZendAccelerator.h
ext/opcache/zend_accelerator_ blacklist.c ext/opcache/zend_accelerator_blacklist.h ext/opcache/zend_accelerator_hash.c ext/opcache/zend
_accelerator_hash.h ext/opcache/zend_accelerator_mo dule.c ext/opcache/zend_accelerator_util_funcs.c ext/opcache/zend_persist.c
ext/opcache/zend_persist.h ext/opcache/zend_persist_
| From: | Anatol Belski | Date: | Wed, 18 Dec 2013 23:29:04 +0000 |
| Subject: | com php-src: correct fix for ext/opcache regarding zend_size _t replacements: ext/opcache/ZendAccelerator.c ext/ opcache/ZendAccelerator.h ext/opcache/zend_accelerator_ blacklist.c ext/opcache/zend_accelerator_blacklist.h ext/opcache/zend_accelerator_hash.c ext/opcache/zend _accelerator_hash.h ext/opcache/zend_accelerator_mo dule.c ext/opcache/zend_accelerator_util_funcs.c ext/opcache/zend_persist.c ext/opcache/zend_persist.h ext/opcache/zend_persist_ |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74517@lists.php.net to get a copy of this message | ||
Commit: cfb76d53f7e988a993deb266aa930dee7f90f9f2
Author: Anatol Belski <ab@php.net> Wed, 18 Dec 2013 15:29:04 -0800
Parents: e9224fc81b91a3c944d99864c56d0fc23ee5feee
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cfb76d53f7e988a993deb266aa930dee7f90f9f2
Log:
correct fix for ext/opcache regarding zend_size_t replacements
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/ZendAccelerator.h
M ext/opcache/zend_accelerator_blacklist.c
M ext/opcache/zend_accelerator_blacklist.h
M ext/opcache/zend_accelerator_hash.c
M ext/opcache/zend_accelerator_hash.h
M ext/opcache/zend_accelerator_module.c
M ext/opcache/zend_accelerator_util_funcs.c
M ext/opcache/zend_persist.c
M ext/opcache/zend_persist.h
M ext/opcache/zend_persist_calc.c
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 348c4f9..d6119e2 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -103,13 +103,13 @@ char *zps_api_failure_reason = NULL; static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); #if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO -static char *(*accelerator_orig_zend_resolve_path)(const char *filename, php_size_t filename_len TSRMLS_DC); +static char *(*accelerator_orig_zend_resolve_path)(const char *filename, zend_size_t filename_len TSRMLS_DC); #endif static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL; static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL; #if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO -static char *accel_php_resolve_path(const char *filename, php_size_t filename_length, const char *path TSRMLS_DC); +static char *accel_php_resolve_path(const char *filename, zend_size_t filename_length, const char *path TSRMLS_DC); #endif #ifdef ZEND_WIN32 @@ -167,7 +167,7 @@ static ZEND_FUNCTION(accel_chdir) } } -static inline char* accel_getcwd(php_size_t *cwd_len TSRMLS_DC) +static inline char* accel_getcwd(zend_size_t *cwd_len TSRMLS_DC) { if (ZCG(cwd)) { *cwd_len = ZCG(cwd_len); @@ -249,7 +249,7 @@ static ZEND_INI_MH(accel_include_path_on_modify) /* Interned strings support */ static char *orig_interned_strings_start; static char *orig_interned_strings_end; -static const char *(*orig_new_interned_string)(const char *str, php_size_t len, int free_src TSRMLS_DC); +static const char *(*orig_new_interned_string)(const char *str, zend_size_t len, int free_src TSRMLS_DC); static void (*orig_interned_strings_snapshot)(TSRMLS_D); static void (*orig_interned_strings_restore)(TSRMLS_D); @@ -257,7 +257,7 @@ static void (*orig_interned_strings_restore)(TSRMLS_D); * it creates interned strings in shared memory when saves a script. * Such interned strings are shared across all PHP processes */ -static const char *accel_new_interned_string_for_php(const char *str, php_size_t len, int free_src TSRMLS_DC) +static const char *accel_new_interned_string_for_php(const char *str, zend_size_t len, int free_src TSRMLS_DC) { return str; } @@ -305,12 +305,12 @@ static void accel_interned_strings_save_state(TSRMLS_D) } #endif -const char *accel_new_interned_string(const char *arKey, php_size_t nKeyLength, int free_src TSRMLS_DC) +const char *accel_new_interned_string(const char *arKey, zend_size_t nKeyLength, int free_src TSRMLS_DC) { /* for now interned strings are supported only for non-ZTS build */ #ifndef ZTS zend_uint_t h; - php_size_t nIndex; + zend_size_t nIndex; Bucket *p; if (arKey >= ZCSG(interned_strings_start) && arKey < ZCSG(interned_strings_end)) { @@ -918,20 +918,20 @@ static unsigned int zend_accel_script_checksum(zend_persistent_script *persisten /* Instead of resolving full real path name each time we need to identify file, * we create a key that consist from requested file name, current working * directory, current include_path, etc */ -char *accel_make_persistent_key_ex(zend_file_handle *file_handle, php_size_t path_length, php_size_t *key_len TSRMLS_DC) +char *accel_make_persistent_key_ex(zend_file_handle *file_handle, zend_size_t path_length, zend_size_t *key_len TSRMLS_DC) { - php_size_t key_length; + zend_size_t key_length; /* CWD and include_path don't matter for absolute file names and streams */ if (ZCG(accel_directives).use_cwd && !IS_ABSOLUTE_PATH(file_handle->filename, path_length) && !is_stream_path(file_handle->filename)) { char *include_path = NULL; - php_size_t include_path_len = 0; + zend_size_t include_path_len = 0; const char *parent_script = NULL; - php_size_t parent_script_len = 0; - php_size_t cur_len = 0; - php_size_t cwd_len; + zend_size_t parent_script_len = 0; + zend_size_t cur_len = 0; + zend_size_t cwd_len; char *cwd; if ((cwd = accel_getcwd(&cwd_len TSRMLS_CC)) == NULL) { @@ -1044,12 +1044,12 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, php_size_t pat return ZCG(key); } -static inline char *accel_make_persistent_key(zend_file_handle *file_handle, php_size_t *key_len TSRMLS_DC) +static inline char *accel_make_persistent_key(zend_file_handle *file_handle, zend_size_t *key_len TSRMLS_DC) { return accel_make_persistent_key_ex(file_handle, strlen(file_handle->filename), key_len TSRMLS_CC); } -int zend_accel_invalidate(const char *filename, php_size_t filename_len, zend_bool force TSRMLS_DC) +int zend_accel_invalidate(const char *filename, zend_size_t filename_len, zend_bool force TSRMLS_DC) { char *realpath; zend_persistent_script *persistent_script; @@ -1103,7 +1103,7 @@ int zend_accel_invalidate(const char *filename, php_size_t filename_len, zend_bo } /* Adds another key for existing cached script */ -static void zend_accel_add_key(char *key, php_size_t key_length, zend_accel_hash_entry *bucket TSRMLS_DC) +static void zend_accel_add_key(char *key, zend_size_t key_length, zend_accel_hash_entry *bucket TSRMLS_DC) { if (!zend_accel_hash_find(&ZCSG(hash), key, key_length + 1)) { if (zend_accel_hash_is_full(&ZCSG(hash))) { @@ -1122,7 +1122,7 @@ static void zend_accel_add_key(char *key, php_size_t key_length, zend_accel_hash } } -static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, php_size_t key_length, int *from_shared_memory TSRMLS_DC) +static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, zend_size_t key_length, int *from_shared_memory TSRMLS_DC) { zend_accel_hash_entry *bucket; uint memory_used; @@ -1274,7 +1274,7 @@ static void zend_accel_set_auto_globals(int mask TSRMLS_DC) } } -static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, php_size_t key_length, zend_op_array **op_array_p, int *from_shared_memory TSRMLS_DC) +static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, zend_size_t key_length, zend_op_array **op_array_p, int *from_shared_memory TSRMLS_DC) { zend_persistent_script *new_persistent_script; zend_op_array *orig_active_op_array; @@ -1468,7 +1468,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T { zend_persistent_script *persistent_script = NULL; char *key = NULL; - php_size_t key_length; + zend_size_t key_length; int from_shared_memory; /* if the script we've got is stored in SHM */ if (!file_handle->filename || @@ -1974,7 +1974,7 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl } /* zend_resolve_path() replacement for PHP 5.3 and above */ -static char* persistent_zend_resolve_path(const char *filename, php_size_t filename_len TSRMLS_DC) +static char* persistent_zend_resolve_path(const char *filename, zend_size_t filename_len TSRMLS_DC) { if (ZCG(enabled) && accel_startup_ok && (ZCG(counted) || ZCSG(accelerator_enabled)) && @@ -1998,7 +1998,7 @@ static char* persistent_zend_resolve_path(const char *filename, php_size_t filen /* we are in include_once or FastCGI request */ zend_file_handle handle; char *key = NULL; - php_size_t key_length; + zend_size_t key_length; char *resolved_path; zend_accel_hash_entry *bucket; zend_persistent_script *persistent_script; diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index bd04525..4067558 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -184,7 +184,7 @@ typedef enum _zend_accel_restart_reason { typedef struct _zend_persistent_script { zend_uint_t hash_value; char *full_path; /* full real path with resolved symlinks */ - php_size_t full_path_len; + zend_size_t full_path_len; zend_op_array main_op_array; HashTable function_table; HashTable class_table; @@ -261,10 +261,10 @@ typedef struct _zend_accel_globals { HashTable bind_hash; /* prototype and zval lookup table */ zend_accel_directives accel_directives; char *cwd; /* current working directory or NULL */ - php_size_t cwd_len; /* "cwd" string length */ + zend_size_t cwd_len; /* "cwd" string length */ char *include_path_key; /* one letter key of current "include_path" */ char *include_path; /* current section of "include_path" directive */ - php_size_t include_path_len; /* "include_path" string length */ + zend_size_t include_path_len; /* "include_path" string length */ int include_path_check; time_t request_time; /* preallocated shared-memory block to save current script */ @@ -273,7 +273,7 @@ typedef struct _zend_accel_globals { zend_op *cache_opline; zend_persistent_script *cache_persistent_script; /* preallocated buffer for keys */ - php_size_t key_len; + zend_size_t key_len; char key[MAXPATHLEN * 8]; } zend_accel_globals; @@ -339,12 +339,12 @@ extern char *zps_api_failure_reason; void accel_shutdown(TSRMLS_D); void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC); void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC); -int zend_accel_invalidate(const char *filename, php_size_t filename_len, zend_bool force TSRMLS_DC); +int zend_accel_invalidate(const char *filename, zend_size_t filename_len, zend_bool force TSRMLS_DC); int zend_accel_script_optimize(zend_persistent_script *persistent_script TSRMLS_DC); int accelerator_shm_read_lock(TSRMLS_D); void accelerator_shm_read_unlock(TSRMLS_D); -char *accel_make_persistent_key_ex(zend_file_handle *file_handle, php_size_t path_length, php_size_t *key_len TSRMLS_DC); +char *accel_make_persistent_key_ex(zend_file_handle *file_handle, zend_size_t path_length, zend_size_t *key_len TSRMLS_DC); zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC); #if !defined(ZEND_DECLARE_INHERITED_CLASS_DELAYED) @@ -355,7 +355,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO -const char *accel_new_interned_string(const char *arKey, php_size_t nKeyLength, int free_src TSRMLS_DC); +const char *accel_new_interned_string(const char *arKey, zend_size_t nKeyLength, int free_src TSRMLS_DC); # define interned_free(s) do { \ if (!IS_INTERNED(s)) { \ diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 4040e8c..b64eaea 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -245,7 +245,7 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) { char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL; FILE *fp; - php_size_t path_length, blacklist_path_length; + zend_size_t path_length, blacklist_path_length; TSRMLS_FETCH(); if ((fp = fopen(filename, "r")) == NULL) { diff --git a/ext/opcache/zend_accelerator_blacklist.h b/ext/opcache/zend_accelerator_blacklist.h index b777584..dc7aae4 100644 --- a/ext/opcache/zend_accelerator_blacklist.h +++ b/ext/opcache/zend_accelerator_blacklist.h @@ -26,7 +26,7 @@ typedef struct _zend_regexp_list zend_regexp_list; typedef struct _zend_blacklist_entry { char *path; - php_size_t path_length; + zend_size_t path_length; int id; } zend_blacklist_entry; diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 2b1e0ab..497d975 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -71,7 +71,7 @@ void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size) * Returns pointer the actual hash entry on success * key needs to be already allocated as it is not copied */ -zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char *key, php_size_t key_length, zend_bool indirect, void *data) +zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char *key, zend_size_t key_length, zend_bool indirect, void *data) { zend_uint_t hash_value; zend_uint_t index; @@ -140,7 +140,7 @@ zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char /* Returns the data associated with key on success * Returns NULL if data doesn't exist */ -void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, php_size_t key_length) +void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, zend_size_t key_length) { zend_uint_t hash_value; zend_uint_t index; @@ -168,7 +168,7 @@ void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, php_size_t ke /* Returns the hash entry associated with key on success * Returns NULL if it doesn't exist */ -zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, char *key, php_size_t key_length) +zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, char *key, zend_size_t key_length) { zend_uint_t hash_value; zend_uint_t index; @@ -193,7 +193,7 @@ zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, c return NULL; } -int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, php_size_t key_length) +int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, zend_size_t key_length) { zend_uint_t hash_value; zend_uint_t index; diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 849aab6..e4b1fb4 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -47,7 +47,7 @@ typedef struct _zend_accel_hash_entry zend_accel_hash_entry; struct _zend_accel_hash_entry { zend_uint_t hash_value; char *key; - php_size_t key_length; + zend_size_t key_length; zend_accel_hash_entry *next; void *data; zend_bool indirect; @@ -67,24 +67,24 @@ void zend_accel_hash_clean(zend_accel_hash *accel_hash); zend_accel_hash_entry* zend_accel_hash_update( zend_accel_hash *accel_hash, char *key, - php_size_t key_length, + zend_size_t key_length, zend_bool indirect, void *data); void* zend_accel_hash_find( zend_accel_hash *accel_hash, char *key, - php_size_t key_length); + zend_size_t key_length); zend_accel_hash_entry* zend_accel_hash_find_entry( zend_accel_hash *accel_hash, char *key, - php_size_t key_length); + zend_size_t key_length); int zend_accel_hash_unlink( zend_accel_hash *accel_hash, char *key, - php_size_t key_length); + zend_size_t key_length); static inline zend_bool zend_accel_hash_is_full(zend_accel_hash *accel_hash) { diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index ba88e6b..1d89e8e 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -80,7 +80,7 @@ static zend_function_entry accel_functions[] = { static int validate_api_restriction(TSRMLS_D) { if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) { - php_size_t len = strlen(ZCG(accel_directives).restrict_api); + zend_size_t len = strlen(ZCG(accel_directives).restrict_api); if (!SG(request_info).path_translated || strlen(SG(request_info).path_translated) < len || @@ -300,10 +300,10 @@ static int ZEND_DECLARE_INHERITED_CLASS_DELAYED_HANDLER(ZEND_OPCODE_HANDLER_ARGS } #endif -static int filename_is_in_cache(char *filename, php_size_t filename_len TSRMLS_DC) +static int filename_is_in_cache(char *filename, zend_size_t filename_len TSRMLS_DC) { char *key; - php_size_t key_length; + zend_size_t key_length; zend_file_handle handle = {0}; zend_persistent_script *persistent_script; @@ -706,7 +706,7 @@ static ZEND_FUNCTION(opcache_reset) static ZEND_FUNCTION(opcache_invalidate) { char *script_name; - php_size_t script_name_len; + zend_size_t script_name_len; zend_bool force = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &script_name, &script_name_len, &force) == FAILURE) { @@ -727,7 +727,7 @@ static ZEND_FUNCTION(opcache_invalidate) static ZEND_FUNCTION(opcache_compile_file) { char *script_name; - php_size_t script_name_len; + zend_size_t script_name_len; zend_file_handle handle; zend_op_array *op_array = NULL; zend_execute_data *orig_execute_data = NULL; diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 5764ca3..f9a6195 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -1016,8 +1016,8 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, persistent_script->full_path) { char *name, *cfilename; char haltoff[] = "__COMPILER_HALT_OFFSET__"; - php_size_t len; - php_size_t clen; + zend_size_t len; + zend_size_t clen; cfilename = persistent_script->full_path; clen = strlen(cfilename); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 4fbdb90..4a26542 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -694,7 +694,7 @@ static void zend_accel_persist_class_table(HashTable *class_table TSRMLS_DC) zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce TSRMLS_CC); } -zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, php_size_t key_length TSRMLS_DC) +zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, zend_size_t key_length TSRMLS_DC) { zend_shared_alloc_clear_xlat_table(); zend_hash_persist(&script->function_table, (zend_persist_func_t) zend_persist_op_array, sizeof(zend_op_array) TSRMLS_CC); diff --git a/ext/opcache/zend_persist.h b/ext/opcache/zend_persist.h index c622483..c56d137 100644 --- a/ext/opcache/zend_persist.h +++ b/ext/opcache/zend_persist.h @@ -23,7 +23,7 @@ #define ZEND_PERSIST_H int zend_accel_script_persistable(zend_persistent_script *script); -uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, php_size_t key_length TSRMLS_DC); -zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, php_size_t key_length TSRMLS_DC); +uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, zend_size_t key_length TSRMLS_DC); +zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, zend_size_t key_length TSRMLS_DC); #endif /* ZEND_PERSIST_H */ diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 4c28979..fb2a898 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -355,7 +355,7 @@ static uint zend_accel_persist_class_table_calc(HashTable *class_table TSRMLS_DC return zend_hash_persist_calc(class_table, (int (*)(void* TSRMLS_DC)) zend_persist_class_entry_calc, sizeof(zend_class_entry*) TSRMLS_CC); } -uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, php_size_t key_length TSRMLS_DC) +uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, zend_size_t key_length TSRMLS_DC) { START_SIZE();
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 348c4f9..d6119e2 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -103,13 +103,13 @@ char *zps_api_failure_reason = NULL; static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); #if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO -static char *(*accelerator_orig_zend_resolve_path)(const char *filename, php_size_t filename_len TSRMLS_DC); +static char *(*accelerator_orig_zend_resolve_path)(const char *filename, zend_size_t filename_len TSRMLS_DC); #endif static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL; static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL; #if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO -static char *accel_php_resolve_path(const char *filename, php_size_t filename_length, const char *path TSRMLS_DC); +static char *accel_php_resolve_path(const char *filename, zend_size_t filename_length, const char *path TSRMLS_DC); #endif #ifdef ZEND_WIN32 @@ -167,7 +167,7 @@ static ZEND_FUNCTION(accel_chdir) } } -static inline char* accel_getcwd(php_size_t *cwd_len TSRMLS_DC) +static inline char* accel_getcwd(zend_size_t *cwd_len TSRMLS_DC) { if (ZCG(cwd)) { *cwd_len = ZCG(cwd_len); @@ -249,7 +249,7 @@ static ZEND_INI_MH(accel_include_path_on_modify) /* Interned strings support */ static char *orig_interned_strings_start; static char *orig_interned_strings_end; -static const char *(*orig_new_interned_string)(const char *str, php_size_t len, int free_src TSRMLS_DC); +static const char *(*orig_new_interned_string)(const char *str, zend_size_t len, int free_src TSRMLS_DC); static void (*orig_interned_strings_snapshot)(TSRMLS_D); static void (*orig_interned_strings_restore)(TSRMLS_D); @@ -257,7 +257,7 @@ static void (*orig_interned_strings_restore)(TSRMLS_D); * it creates interned strings in shared memory when saves a script. * Such interned strings are shared across all PHP processes */ -static const char *accel_new_interned_string_for_php(const char *str, php_size_t len, int free_src TSRMLS_DC) +static const char *accel_new_interned_string_for_php(const char *str, zend_size_t len, int free_src TSRMLS_DC) { return str; } @@ -305,12 +305,12 @@ static void accel_interned_strings_save_state(TSRMLS_D) } #endif -const char *accel_new_interned_string(const char *arKey, php_size_t nKeyLength, int free_src TSRMLS_DC) +const char *accel_new_interned_string(const char *arKey, zend_size_t nKeyLength, int free_src TSRMLS_DC) { /* for now interned strings are supported only for non-ZTS build */ #ifndef ZTS zend_uint_t h; - php_size_t nIndex; + zend_size_t nIndex; Bucket *p; if (arKey >= ZCSG(interned_strings_start) && arKey < ZCSG(interned_strings_end)) { @@ -918,20 +918,20 @@ static unsigned int zend_accel_script_checksum(zend_persistent_script *persisten /* Instead of resolving full real path name each time we need to identify file, * we create a key that consist from requested file name, current working * directory, current include_path, etc */ -char *accel_make_persistent_key_ex(zend_file_handle *file_handle, php_size_t path_length, php_size_t *key_len TSRMLS_DC) +char *accel_make_persistent_key_ex(zend_file_handle *file_handle, zend_size_t path_length, zend_size_t *key_len TSRMLS_DC) { - php_size_t key_length; + zend_size_t key_length; /* CWD and include_path don't matter for absolute file names and streams */ if (ZCG(accel_directives).use_cwd && !IS_ABSOLUTE_PATH(file_handle->filename, path_length) && !is_stream_path(file_handle->filename)) { char *include_path = NULL; - php_size_t include_path_len = 0; + zend_size_t include_path_len = 0; const char *parent_script = NULL; - php_size_t parent_script_len = 0; - php_size_t cur_len = 0; - php_size_t cwd_len; + zend_size_t parent_script_len = 0; + zend_size_t cur_len = 0; + zend_size_t cwd_len; char *cwd; if ((cwd = accel_getcwd(&cwd_len TSRMLS_CC)) == NULL) { @@ -1044,12 +1044,12 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, php_size_t pat return ZCG(key); } -static inline char *accel_make_persistent_key(zend_file_handle *file_handle, php_size_t *key_len TSRMLS_DC) +static inline char *accel_make_persistent_key(zend_file_handle *file_handle, zend_size_t *key_len TSRMLS_DC) { return accel_make_persistent_key_ex(file_handle, strlen(file_handle->filename), key_len TSRMLS_CC); } -int zend_accel_invalidate(const char *filename, php_size_t filename_len, zend_bool force TSRMLS_DC) +int zend_accel_invalidate(const char *filename, zend_size_t filename_len, zend_bool force TSRMLS_DC) { char *realpath; zend_persistent_script *persistent_script; @@ -1103,7 +1103,7 @@ int zend_accel_invalidate(const char *filename, php_size_t filename_len, zend_bo } /* Adds another key for existing cached script */ -static void zend_accel_add_key(char *key, php_size_t key_length, zend_accel_hash_entry *bucket TSRMLS_DC) +static void zend_accel_add_key(char *key, zend_size_t key_length, zend_accel_hash_entry *bucket TSRMLS_DC) { if (!zend_accel_hash_find(&ZCSG(hash), key, key_length + 1)) { if (zend_accel_hash_is_full(&ZCSG(hash))) { @@ -1122,7 +1122,7 @@ static void zend_accel_add_key(char *key, php_size_t key_length, zend_accel_hash } } -static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, php_size_t key_length, int *from_shared_memory TSRMLS_DC) +static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, zend_size_t key_length, int *from_shared_memory TSRMLS_DC) { zend_accel_hash_entry *bucket; uint memory_used; @@ -1274,7 +1274,7 @@ static void zend_accel_set_auto_globals(int mask TSRMLS_DC) } } -static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, php_size_t key_length, zend_op_array **op_array_p, int *from_shared_memory TSRMLS_DC) +static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, zend_size_t key_length, zend_op_array **op_array_p, int *from_shared_memory TSRMLS_DC) { zend_persistent_script *new_persistent_script; zend_op_array *orig_active_op_array; @@ -1468,7 +1468,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T { zend_persistent_script *persistent_script = NULL; char *key = NULL; - php_size_t key_length; + zend_size_t key_length; int from_shared_memory; /* if the script we've got is stored in SHM */ if (!file_handle->filename || @@ -1974,7 +1974,7 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl } /* zend_resolve_path() replacement for PHP 5.3 and above */ -static char* persistent_zend_resolve_path(const char *filename, php_size_t filename_len TSRMLS_DC) +static char* persistent_zend_resolve_path(const char *filename, zend_size_t filename_len TSRMLS_DC) { if (ZCG(enabled) && accel_startup_ok && (ZCG(counted) || ZCSG(accelerator_enabled)) && @@ -1998,7 +1998,7 @@ static char* persistent_zend_resolve_path(const char *filename, php_size_t filen /* we are in include_once or FastCGI request */ zend_file_handle handle; char *key = NULL; - php_size_t key_length; + zend_size_t key_length; char *resolved_path; zend_accel_hash_entry *bucket; zend_persistent_script *persistent_script; diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index bd04525..4067558 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -184,7 +184,7 @@ typedef enum _zend_accel_restart_reason { typedef struct _zend_persistent_script { zend_uint_t hash_value; char *full_path; /* full real path with resolved symlinks */ - php_size_t full_path_len; + zend_size_t full_path_len; zend_op_array main_op_array; HashTable function_table; HashTable class_table; @@ -261,10 +261,10 @@ typedef struct _zend_accel_globals { HashTable bind_hash; /* prototype and zval lookup table */ zend_accel_directives accel_directives; char *cwd; /* current working directory or NULL */ - php_size_t cwd_len; /* "cwd" string length */ + zend_size_t cwd_len; /* "cwd" string length */ char *include_path_key; /* one letter key of current "include_path" */ char *include_path; /* current section of "include_path" directive */ - php_size_t include_path_len; /* "include_path" string length */ + zend_size_t include_path_len; /* "include_path" string length */ int include_path_check; time_t request_time; /* preallocated shared-memory block to save current script */ @@ -273,7 +273,7 @@ typedef struct _zend_accel_globals { zend_op *cache_opline; zend_persistent_script *cache_persistent_script; /* preallocated buffer for keys */ - php_size_t key_len; + zend_size_t key_len; char key[MAXPATHLEN * 8]; } zend_accel_globals; @@ -339,12 +339,12 @@ extern char *zps_api_failure_reason; void accel_shutdown(TSRMLS_D); void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC); void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC); -int zend_accel_invalidate(const char *filename, php_size_t filename_len, zend_bool force TSRMLS_DC); +int zend_accel_invalidate(const char *filename, zend_size_t filename_len, zend_bool force TSRMLS_DC); int zend_accel_script_optimize(zend_persistent_script *persistent_script TSRMLS_DC); int accelerator_shm_read_lock(TSRMLS_D); void accelerator_shm_read_unlock(TSRMLS_D); -char *accel_make_persistent_key_ex(zend_file_handle *file_handle, php_size_t path_length, php_size_t *key_len TSRMLS_DC); +char *accel_make_persistent_key_ex(zend_file_handle *file_handle, zend_size_t path_length, zend_size_t *key_len TSRMLS_DC); zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC); #if !defined(ZEND_DECLARE_INHERITED_CLASS_DELAYED) @@ -355,7 +355,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO -const char *accel_new_interned_string(const char *arKey, php_size_t nKeyLength, int free_src TSRMLS_DC); +const char *accel_new_interned_string(const char *arKey, zend_size_t nKeyLength, int free_src TSRMLS_DC); # define interned_free(s) do { \ if (!IS_INTERNED(s)) { \ diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 4040e8c..b64eaea 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -245,7 +245,7 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) { char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL; FILE *fp; - php_size_t path_length, blacklist_path_length; + zend_size_t path_length, blacklist_path_length; TSRMLS_FETCH(); if ((fp = fopen(filename, "r")) == NULL) { diff --git a/ext/opcache/zend_accelerator_blacklist.h b/ext/opcache/zend_accelerator_blacklist.h index b777584..dc7aae4 100644 --- a/ext/opcache/zend_accelerator_blacklist.h +++ b/ext/opcache/zend_accelerator_blacklist.h @@ -26,7 +26,7 @@ typedef struct _zend_regexp_list zend_regexp_list; typedef struct _zend_blacklist_entry { char *path; - php_size_t path_length; + zend_size_t path_length; int id; } zend_blacklist_entry; diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 2b1e0ab..497d975 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -71,7 +71,7 @@ void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size) * Returns pointer the actual hash entry on success * key needs to be already allocated as it is not copied */ -zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char *key, php_size_t key_length, zend_bool indirect, void *data) +zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char *key, zend_size_t key_length, zend_bool indirect, void *data) { zend_uint_t hash_value; zend_uint_t index; @@ -140,7 +140,7 @@ zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char /* Returns the data associated with key on success * Returns NULL if data doesn't exist */ -void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, php_size_t key_length) +void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, zend_size_t key_length) { zend_uint_t hash_value; zend_uint_t index; @@ -168,7 +168,7 @@ void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, php_size_t ke /* Returns the hash entry associated with key on success * Returns NULL if it doesn't exist */ -zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, char *key, php_size_t key_length) +zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, char *key, zend_size_t key_length) { zend_uint_t hash_value; zend_uint_t index; @@ -193,7 +193,7 @@ zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, c return NULL; } -int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, php_size_t key_length) +int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, zend_size_t key_length) { zend_uint_t hash_value; zend_uint_t index; diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 849aab6..e4b1fb4 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -47,7 +47,7 @@ typedef struct _zend_accel_hash_entry zend_accel_hash_entry; struct _zend_accel_hash_entry { zend_uint_t hash_value; char *key; - php_size_t key_length; + zend_size_t key_length; zend_accel_hash_entry *next; void *data; zend_bool indirect; @@ -67,24 +67,24 @@ void zend_accel_hash_clean(zend_accel_hash *accel_hash); zend_accel_hash_entry* zend_accel_hash_update( zend_accel_hash *accel_hash, char *key, - php_size_t key_length, + zend_size_t key_length, zend_bool indirect, void *data); void* zend_accel_hash_find( zend_accel_hash *accel_hash, char *key, - php_size_t key_length); + zend_size_t key_length); zend_accel_hash_entry* zend_accel_hash_find_entry( zend_accel_hash *accel_hash, char *key, - php_size_t key_length); + zend_size_t key_length); int zend_accel_hash_unlink( zend_accel_hash *accel_hash, char *key, - php_size_t key_length); + zend_size_t key_length); static inline zend_bool zend_accel_hash_is_full(zend_accel_hash *accel_hash) { diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index ba88e6b..1d89e8e 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -80,7 +80,7 @@ static zend_function_entry accel_functions[] = { static int validate_api_restriction(TSRMLS_D) { if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) { - php_size_t len = strlen(ZCG(accel_directives).restrict_api); + zend_size_t len = strlen(ZCG(accel_directives).restrict_api); if (!SG(request_info).path_translated || strlen(SG(request_info).path_translated) < len || @@ -300,10 +300,10 @@ static int ZEND_DECLARE_INHERITED_CLASS_DELAYED_HANDLER(ZEND_OPCODE_HANDLER_ARGS } #endif -static int filename_is_in_cache(char *filename, php_size_t filename_len TSRMLS_DC) +static int filename_is_in_cache(char *filename, zend_size_t filename_len TSRMLS_DC) { char *key; - php_size_t key_length; + zend_size_t key_length; zend_file_handle handle = {0}; zend_persistent_script *persistent_script; @@ -706,7 +706,7 @@ static ZEND_FUNCTION(opcache_reset) static ZEND_FUNCTION(opcache_invalidate) { char *script_name; - php_size_t script_name_len; + zend_size_t script_name_len; zend_bool force = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &script_name, &script_name_len, &force) == FAILURE) { @@ -727,7 +727,7 @@ static ZEND_FUNCTION(opcache_invalidate) static ZEND_FUNCTION(opcache_compile_file) { char *script_name; - php_size_t script_name_len; + zend_size_t script_name_len; zend_file_handle handle; zend_op_array *op_array = NULL; zend_execute_data *orig_execute_data = NULL; diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 5764ca3..f9a6195 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -1016,8 +1016,8 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, persistent_script->full_path) { char *name, *cfilename; char haltoff[] = "__COMPILER_HALT_OFFSET__"; - php_size_t len; - php_size_t clen; + zend_size_t len; + zend_size_t clen; cfilename = persistent_script->full_path; clen = strlen(cfilename); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 4fbdb90..4a26542 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -694,7 +694,7 @@ static void zend_accel_persist_class_table(HashTable *class_table TSRMLS_DC) zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce TSRMLS_CC); } -zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, php_size_t key_length TSRMLS_DC) +zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, zend_size_t key_length TSRMLS_DC) { zend_shared_alloc_clear_xlat_table(); zend_hash_persist(&script->function_table, (zend_persist_func_t) zend_persist_op_array, sizeof(zend_op_array) TSRMLS_CC); diff --git a/ext/opcache/zend_persist.h b/ext/opcache/zend_persist.h index c622483..c56d137 100644 --- a/ext/opcache/zend_persist.h +++ b/ext/opcache/zend_persist.h @@ -23,7 +23,7 @@ #define ZEND_PERSIST_H int zend_accel_script_persistable(zend_persistent_script *script); -uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, php_size_t key_length TSRMLS_DC); -zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, php_size_t key_length TSRMLS_DC); +uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, zend_size_t key_length TSRMLS_DC); +zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, zend_size_t key_length TSRMLS_DC); #endif /* ZEND_PERSIST_H */ diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 4c28979..fb2a898 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -355,7 +355,7 @@ static uint zend_accel_persist_class_table_calc(HashTable *class_table TSRMLS_DC return zend_hash_persist_calc(class_table, (int (*)(void* TSRMLS_DC)) zend_persist_class_entry_calc, sizeof(zend_class_entry*) TSRMLS_CC); } -uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, php_size_t key_length TSRMLS_DC) +uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, zend_size_t key_length TSRMLS_DC) { START_SIZE();