diff options
Diffstat (limited to 'ext/opcache')
| -rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 8 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/compact_literals.c | 14 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/nop_removal.c | 12 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/pass1_5.c | 14 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/pass3.c | 6 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/zend_optimizer.c | 4 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/zend_optimizer_internal.h | 2 | ||||
| -rw-r--r-- | ext/opcache/ZendAccelerator.c | 10 | ||||
| -rw-r--r-- | ext/opcache/zend_accelerator_hash.c | 10 | ||||
| -rw-r--r-- | ext/opcache/zend_accelerator_hash.h | 18 | ||||
| -rw-r--r-- | ext/opcache/zend_accelerator_util_funcs.c | 36 | ||||
| -rw-r--r-- | ext/opcache/zend_persist.c | 20 | ||||
| -rw-r--r-- | ext/opcache/zend_persist_calc.c | 4 |
13 files changed, 79 insertions, 79 deletions
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 826e5716c8..0276397393 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -106,7 +106,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz zend_op *opline; zend_op *end = op_array->opcodes + op_array->last; zend_code_block *blocks, *cur_block; - zend_uint opno = 0; + uint32_t opno = 0; memset(cfg, 0, sizeof(zend_cfg)); blocks = cfg->blocks = zend_arena_calloc(&ctx->arena, op_array->last + 2, sizeof(zend_code_block)); @@ -1264,8 +1264,8 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array) op_array->opcodes = erealloc(new_opcodes, op_array->last * sizeof(zend_op)); /* adjust early binding list */ - if (op_array->early_binding != (zend_uint)-1) { - zend_uint *opline_num = &op_array->early_binding; + if (op_array->early_binding != (uint32_t)-1) { + uint32_t *opline_num = &op_array->early_binding; zend_op *end; opline = op_array->opcodes; @@ -1441,7 +1441,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra if (block->op2_to) { zend_uchar same_type = ZEND_OP1_TYPE(last_op); - zend_uint same_var = VAR_NUM_EX(last_op->op1); + uint32_t same_var = VAR_NUM_EX(last_op->op1); zend_op *target; zend_op *target_end; zend_code_block *target_block = block->op2_to;; diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c index a8cbcbfc8d..87cae3b12c 100644 --- a/ext/opcache/Optimizer/compact_literals.c +++ b/ext/opcache/Optimizer/compact_literals.c @@ -44,7 +44,7 @@ #define LITERAL_NUM_SLOTS(info) ((info & LITERAL_NUM_SLOTS_MASK) >> LITERAL_NUM_SLOTS_SHIFT) typedef struct _literal_info { - zend_uint flags; /* bitmask (see defines above) */ + uint32_t flags; /* bitmask (see defines above) */ union { int num; /* variable number or class name literal number */ } u; @@ -71,9 +71,9 @@ static void optimizer_literal_obj_info(literal_info *info, zend_uchar op_type, znode_op op, int constant, - zend_uint kind, - zend_uint slots, - zend_uint related, + uint32_t kind, + uint32_t slots, + uint32_t related, zend_op_array *op_array) { /* For now we merge only $this object properties and methods. @@ -92,9 +92,9 @@ static void optimizer_literal_class_info(literal_info *info, zend_uchar op_type, znode_op op, int constant, - zend_uint kind, - zend_uint slots, - zend_uint related, + uint32_t kind, + uint32_t slots, + uint32_t related, zend_op_array *op_array) { if (op_type == IS_CONST) { diff --git a/ext/opcache/Optimizer/nop_removal.c b/ext/opcache/Optimizer/nop_removal.c index 80da02ce32..2d695c0495 100644 --- a/ext/opcache/Optimizer/nop_removal.c +++ b/ext/opcache/Optimizer/nop_removal.c @@ -26,12 +26,12 @@ static void nop_removal(zend_op_array *op_array) { zend_op *end, *opline; - zend_uint new_count, i, shift; + uint32_t new_count, i, shift; int j; - zend_uint *shiftlist; + uint32_t *shiftlist; ALLOCA_FLAG(use_heap); - shiftlist = (zend_uint *)DO_ALLOCA(sizeof(zend_uint) * op_array->last); + shiftlist = (uint32_t *)DO_ALLOCA(sizeof(uint32_t) * op_array->last); i = new_count = shift = 0; end = op_array->opcodes + op_array->last; for (opline = op_array->opcodes; opline < end; opline++) { @@ -120,13 +120,13 @@ static void nop_removal(zend_op_array *op_array) } /* update early binding list */ - if (op_array->early_binding != (zend_uint)-1) { - zend_uint *opline_num = &op_array->early_binding; + if (op_array->early_binding != (uint32_t)-1) { + uint32_t *opline_num = &op_array->early_binding; do { *opline_num -= shiftlist[*opline_num]; opline_num = &ZEND_RESULT(&op_array->opcodes[*opline_num]).opline_num; - } while (*opline_num != (zend_uint)-1); + } while (*opline_num != (uint32_t)-1); } } FREE_ALLOCA(shiftlist); diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index e4561f50b3..cc8a37e529 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -60,7 +60,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { ZEND_OP2_TYPE(opline) == IS_CONST) { /* binary operation with constant operands */ int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) = get_binary_op(opline->opcode); - zend_uint tv = ZEND_RESULT(opline).var; /* temporary variable */ + uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */ zval result; int er; @@ -92,7 +92,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { opline->extended_value != IS_OBJECT && opline->extended_value != IS_RESOURCE) { /* cast of constant operand */ - zend_uint tv = ZEND_RESULT(opline).var; /* temporary variable */ + uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */ zval res; res = ZEND_OP1_LITERAL(opline); zval_copy_ctor(&res); @@ -135,7 +135,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { /* unary operation on constant operand */ unary_op_type unary_op = get_unary_op(opline->opcode); zval result; - zend_uint tv = ZEND_RESULT(opline).var; /* temporary variable */ + uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */ int er; er = EG(error_reporting); @@ -238,7 +238,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { fake_execute_data.func = (zend_function*)op_array; EG(current_execute_data) = &fake_execute_data; if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1 TSRMLS_CC)) != NULL) { - zend_uint tv = ZEND_RESULT(opline).var; + uint32_t tv = ZEND_RESULT(opline).var; literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); @@ -252,7 +252,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { ZEND_OP2_TYPE(opline) == IS_CONST && Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) { /* substitute persistent constants */ - zend_uint tv = ZEND_RESULT(opline).var; + uint32_t tv = ZEND_RESULT(opline).var; zval c; if (!zend_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &c, 1 TSRMLS_CC)) { @@ -300,7 +300,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { } if (ce) { - zend_uint tv = ZEND_RESULT(opline).var; + uint32_t tv = ZEND_RESULT(opline).var; zval *c, t; if ((c = zend_hash_find(&ce->constants_table, @@ -480,7 +480,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { case ZEND_DEFINED: { zval c; - zend_uint tv = ZEND_RESULT(opline).var; + uint32_t tv = ZEND_RESULT(opline).var; if (!zend_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &c, 0 TSRMLS_CC)) { break; } diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c index 810eedb646..1444fa6d3d 100644 --- a/ext/opcache/Optimizer/pass3.c +++ b/ext/opcache/Optimizer/pass3.c @@ -48,13 +48,13 @@ if (ZEND_OPTIMIZER_PASS_3 & OPTIMIZATION_LEVEL) { zend_op *opline; zend_op *end = op_array->opcodes + op_array->last; - zend_uint *jmp_hitlist; + uint32_t *jmp_hitlist; int jmp_hitlist_count; int i; - zend_uint opline_num = 0; + uint32_t opline_num = 0; ALLOCA_FLAG(use_heap); - jmp_hitlist = (zend_uint *)DO_ALLOCA(sizeof(zend_uint)*op_array->last); + jmp_hitlist = (uint32_t *)DO_ALLOCA(sizeof(uint32_t)*op_array->last); opline = op_array->opcodes; while (opline < end) { diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index 81ff920e10..9f14bac614 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -290,7 +290,7 @@ check_numeric: static int replace_var_by_const(zend_op_array *op_array, zend_op *opline, - zend_uint var, + uint32_t var, zval *val TSRMLS_DC) { zend_op *end = op_array->opcodes + op_array->last; @@ -344,7 +344,7 @@ static int replace_var_by_const(zend_op_array *op_array, static void replace_tmp_by_const(zend_op_array *op_array, zend_op *opline, - zend_uint var, + uint32_t var, zval *val TSRMLS_DC) { diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h index b0ba12abc7..1ac883b561 100644 --- a/ext/opcache/Optimizer/zend_optimizer_internal.h +++ b/ext/opcache/Optimizer/zend_optimizer_internal.h @@ -25,7 +25,7 @@ #include "ZendAccelerator.h" #define VAR_NUM(v) EX_VAR_TO_NUM(v) -#define NUM_VAR(v) ((zend_uint)(zend_uintptr_t)EX_VAR_NUM_2(0, v)) +#define NUM_VAR(v) ((uint32_t)(zend_uintptr_t)EX_VAR_NUM_2(0, v)) #define INV_COND(op) ((op) == ZEND_JMPZ ? ZEND_JMPNZ : ZEND_JMPZ) #define INV_EX_COND(op) ((op) == ZEND_JMPZ_EX ? ZEND_JMPNZ : ZEND_JMPZ) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index ad5a08a3d1..85adb20b50 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1283,7 +1283,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han zend_op_array *op_array; int do_bailout = 0; accel_time_t timestamp = 0; - zend_uint orig_compiler_options = 0; + uint32_t orig_compiler_options = 0; /* Try to open file */ if (file_handle->type == ZEND_HANDLE_FILENAME) { @@ -1581,7 +1581,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T /* If script was not found or invalidated by validate_timestamps */ if (!persistent_script) { - zend_uint old_const_num = zend_hash_next_free_element(EG(zend_constants)); + uint32_t old_const_num = zend_hash_next_free_element(EG(zend_constants)); zend_op_array *op_array; /* Cache miss.. */ @@ -1608,7 +1608,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T } if (from_shared_memory) { /* Delete immutable arrays moved into SHM */ - zend_uint new_const_num = zend_hash_next_free_element(EG(zend_constants)); + uint32_t new_const_num = zend_hash_next_free_element(EG(zend_constants)); while (new_const_num > old_const_num) { new_const_num--; zend_hash_index_del(EG(zend_constants), new_const_num); @@ -2185,13 +2185,13 @@ static int zend_accel_init_shm(TSRMLS_D) if (ZCG(accel_directives).interned_strings_buffer) { ZCSG(interned_strings).nTableMask = ZCSG(interned_strings).nTableSize - 1; ZCSG(interned_strings).arData = zend_shared_alloc(ZCSG(interned_strings).nTableSize * sizeof(Bucket)); - ZCSG(interned_strings).arHash = (zend_uint*)zend_shared_alloc(ZCSG(interned_strings).nTableSize * sizeof(zend_uint)); + ZCSG(interned_strings).arHash = (uint32_t*)zend_shared_alloc(ZCSG(interned_strings).nTableSize * sizeof(uint32_t)); ZCSG(interned_strings_start) = zend_shared_alloc((ZCG(accel_directives).interned_strings_buffer * 1024 * 1024)); if (!ZCSG(interned_strings).arData || !ZCSG(interned_strings_start)) { zend_accel_error(ACCEL_LOG_FATAL, ACCELERATOR_PRODUCT_NAME " cannot allocate buffer for interned strings"); return FAILURE; } - memset(ZCSG(interned_strings).arHash, INVALID_IDX, ZCSG(interned_strings).nTableSize * sizeof(zend_uint)); + memset(ZCSG(interned_strings).arHash, INVALID_IDX, ZCSG(interned_strings).nTableSize * sizeof(uint32_t)); ZCSG(interned_strings_end) = ZCSG(interned_strings_start) + (ZCG(accel_directives).interned_strings_buffer * 1024 * 1024); ZCSG(interned_strings_top) = ZCSG(interned_strings_start); diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 02474fc11f..671792239b 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -36,7 +36,7 @@ void zend_accel_hash_clean(zend_accel_hash *accel_hash) memset(accel_hash->hash_table, 0, sizeof(zend_accel_hash_entry *)*accel_hash->max_num_entries); } -void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size) +void zend_accel_hash_init(zend_accel_hash *accel_hash, uint32_t hash_size) { uint i; @@ -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, zend_uint key_length, zend_bool indirect, void *data) +zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char *key, uint32_t key_length, zend_bool indirect, void *data) { zend_ulong hash_value; zend_ulong 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, zend_uint key_length) +void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, uint32_t key_length) { zend_ulong hash_value; zend_ulong index; @@ -168,7 +168,7 @@ void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, zend_uint key /* 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, zend_uint key_length) +zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, char *key, uint32_t key_length) { zend_ulong hash_value; zend_ulong 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, zend_uint key_length) +int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, uint32_t key_length) { zend_ulong hash_value; zend_ulong index; diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 2de28bffa7..5c995b43ee 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_ulong hash_value; char *key; - zend_uint key_length; + uint32_t key_length; zend_accel_hash_entry *next; void *data; zend_bool indirect; @@ -56,35 +56,35 @@ struct _zend_accel_hash_entry { typedef struct _zend_accel_hash { zend_accel_hash_entry **hash_table; zend_accel_hash_entry *hash_entries; - zend_uint num_entries; - zend_uint max_num_entries; - zend_uint num_direct_entries; + uint32_t num_entries; + uint32_t max_num_entries; + uint32_t num_direct_entries; } zend_accel_hash; -void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size); +void zend_accel_hash_init(zend_accel_hash *accel_hash, uint32_t hash_size); 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, - zend_uint key_length, + uint32_t key_length, zend_bool indirect, void *data); void* zend_accel_hash_find( zend_accel_hash *accel_hash, char *key, - zend_uint key_length); + uint32_t key_length); zend_accel_hash_entry* zend_accel_hash_find_entry( zend_accel_hash *accel_hash, char *key, - zend_uint key_length); + uint32_t key_length); int zend_accel_hash_unlink( zend_accel_hash *accel_hash, char *key, - zend_uint key_length); + uint32_t key_length); static inline zend_bool zend_accel_hash_is_full(zend_accel_hash *accel_hash) { diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index e096869b83..46eb03ee47 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -27,7 +27,7 @@ #define ZEND_PROTECTED_REFCOUNT (1<<30) -static zend_uint zend_accel_refcount = ZEND_PROTECTED_REFCOUNT; +static uint32_t zend_accel_refcount = ZEND_PROTECTED_REFCOUNT; #if SIZEOF_SIZE_T <= SIZEOF_ZEND_INT /* If sizeof(void*) == sizeof(ulong) we can use zend_hash index functions */ @@ -41,7 +41,7 @@ static zend_uint zend_accel_refcount = ZEND_PROTECTED_REFCOUNT; typedef int (*id_function_t)(void *, void *); typedef void (*unique_copy_ctor_func_t)(void *pElement); -static const zend_uint uninitialized_bucket = {INVALID_IDX}; +static const uint32_t uninitialized_bucket = {INVALID_IDX}; static int zend_prepare_function_for_execution(zend_op_array *op_array); static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind); @@ -113,7 +113,7 @@ static int compact_hash_table(HashTable *ht) return 1; } - d = (Bucket *)pemalloc(nSize * (sizeof(Bucket) + sizeof(zend_uint)), ht->u.flags & HASH_FLAG_PERSISTENT); + d = (Bucket *)pemalloc(nSize * (sizeof(Bucket) + sizeof(uint32_t)), ht->u.flags & HASH_FLAG_PERSISTENT); if (!d) { return 0; } @@ -129,7 +129,7 @@ static int compact_hash_table(HashTable *ht) pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT); ht->arData = d; - ht->arHash = (zend_uint *)(d + nSize); + ht->arHash = (uint32_t *)(d + nSize); ht->nTableSize = nSize; ht->nTableMask = ht->nTableSize - 1; zend_hash_rehash(ht); @@ -348,14 +348,14 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind) ht->nInternalPointer = source->nNumOfElements ? 0 : INVALID_IDX; if (!ht->nTableMask) { - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; return; } if (source->u.flags & HASH_FLAG_PACKED) { ht->u.flags |= HASH_FLAG_PACKED; ht->arData = (Bucket *) emalloc(ht->nTableSize * sizeof(Bucket)); - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; for (idx = 0; idx < source->nNumUsed; idx++) { p = source->arData + idx; @@ -379,9 +379,9 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind) zend_clone_zval(&q->val, bind TSRMLS_CC); } } else { - ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(zend_uint))); - ht->arHash = (zend_uint*)(ht->arData + ht->nTableSize); - memset(ht->arHash, INVALID_IDX, sizeof(zend_uint) * ht->nTableSize); + ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t))); + ht->arHash = (uint32_t*)(ht->arData + ht->nTableSize); + memset(ht->arHash, INVALID_IDX, sizeof(uint32_t) * ht->nTableSize); for (idx = 0; idx < source->nNumUsed; idx++) { p = source->arData + idx; @@ -427,14 +427,14 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class ht->nInternalPointer = source->nNumOfElements ? 0 : INVALID_IDX; if (!ht->nTableMask) { - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; return; } ZEND_ASSERT(!(source->u.flags & HASH_FLAG_PACKED)); - ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(zend_uint))); - ht->arHash = (zend_uint *)(ht->arData + ht->nTableSize); - memset(ht->arHash, INVALID_IDX, sizeof(zend_uint) * ht->nTableSize); + ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t))); + ht->arHash = (uint32_t *)(ht->arData + ht->nTableSize); + memset(ht->arHash, INVALID_IDX, sizeof(uint32_t) * ht->nTableSize); for (idx = 0; idx < source->nNumUsed; idx++) { p = source->arData + idx; @@ -504,14 +504,14 @@ static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_cla ht->nInternalPointer = source->nNumOfElements ? 0 : INVALID_IDX; if (!ht->nTableMask) { - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; return; } ZEND_ASSERT(!(source->u.flags & HASH_FLAG_PACKED)); - ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(zend_uint))); - ht->arHash = (zend_uint*)(ht->arData + ht->nTableSize); - memset(ht->arHash, INVALID_IDX, sizeof(zend_uint) * ht->nTableSize); + ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t))); + ht->arHash = (uint32_t*)(ht->arData + ht->nTableSize); + memset(ht->arHash, INVALID_IDX, sizeof(uint32_t) * ht->nTableSize); for (idx = 0; idx < source->nNumUsed; idx++) { p = source->arData + idx; @@ -898,7 +898,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, } } - if (op_array->early_binding != (zend_uint)-1) { + if (op_array->early_binding != (uint32_t)-1) { zend_string *orig_compiled_filename = CG(compiled_filename); CG(compiled_filename) = persistent_script->full_path; zend_do_delayed_early_binding(op_array TSRMLS_CC); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 67e3ab05a1..2427cfdec8 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -67,7 +67,7 @@ typedef void (*zend_persist_func_t)(zval* TSRMLS_DC); static void zend_persist_zval(zval *z TSRMLS_DC); static void zend_persist_zval_const(zval *z TSRMLS_DC); -static const zend_uint uninitialized_bucket = {INVALID_IDX}; +static const uint32_t uninitialized_bucket = {INVALID_IDX}; static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement TSRMLS_DC) { @@ -75,19 +75,19 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement Bucket *p; if (!ht->nTableMask) { - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; return; } if (ht->u.flags & HASH_FLAG_PACKED) { zend_accel_store(ht->arData, sizeof(Bucket) * ht->nNumUsed); - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; } else { Bucket *d = (Bucket*)ZCG(mem); - zend_uint *h = (zend_uint*)(d + ht->nNumUsed); + uint32_t *h = (uint32_t*)(d + ht->nNumUsed); ZCG(mem) = (void*)(h + ht->nTableSize); memcpy(d, ht->arData, sizeof(Bucket) * ht->nNumUsed); - memcpy(h, ht->arHash, sizeof(zend_uint) * ht->nTableSize); + memcpy(h, ht->arHash, sizeof(uint32_t) * ht->nTableSize); efree(ht->arData); ht->arData = d; ht->arHash = h; @@ -112,19 +112,19 @@ static void zend_hash_persist_immutable(HashTable *ht TSRMLS_DC) Bucket *p; if (!ht->nTableMask) { - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; return; } if (ht->u.flags & HASH_FLAG_PACKED) { ht->arData = zend_accel_memdup(ht->arData, sizeof(Bucket) * ht->nNumUsed); - ht->arHash = (zend_uint*)&uninitialized_bucket; + ht->arHash = (uint32_t*)&uninitialized_bucket; } else { Bucket *d = (Bucket*)ZCG(mem); - zend_uint *h = (zend_uint*)(d + ht->nNumUsed); + uint32_t *h = (uint32_t*)(d + ht->nNumUsed); ZCG(mem) = (void*)(h + ht->nTableSize); memcpy(d, ht->arData, sizeof(Bucket) * ht->nNumUsed); - memcpy(h, ht->arHash, sizeof(zend_uint) * ht->nTableSize); + memcpy(h, ht->arHash, sizeof(uint32_t) * ht->nTableSize); ht->arData = d; ht->arHash = h; } @@ -399,7 +399,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc ZEND_ASSERT(new_ptr != NULL); op_array->arg_info = new_ptr; } else { - zend_uint i; + uint32_t i; zend_accel_store(op_array->arg_info, sizeof(zend_arg_info) * op_array->num_args); for (i = 0; i < op_array->num_args; i++) { diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 1ffc98597a..1328213397 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -61,7 +61,7 @@ static uint zend_hash_persist_calc(HashTable *ht, uint (*pPersistElement)(zval * if (ht->u.flags & HASH_FLAG_PACKED) { ADD_SIZE(sizeof(Bucket) * ht->nNumUsed); } else { - ADD_SIZE(sizeof(Bucket) * ht->nNumUsed + sizeof(zend_uint) * ht->nTableSize); + ADD_SIZE(sizeof(Bucket) * ht->nNumUsed + sizeof(uint32_t) * ht->nTableSize); } for (idx = 0; idx < ht->nNumUsed; idx++) { @@ -194,7 +194,7 @@ static uint zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC) } if (op_array->arg_info) { - zend_uint i; + uint32_t i; ADD_DUP_SIZE(op_array->arg_info, sizeof(zend_arg_info) * op_array->num_args); for (i = 0; i < op_array->num_args; i++) { |
