}
/* Adds another key for existing cached script */
-static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_hash_entry *bucket)
+static void zend_accel_add_key(const char *key, unsigned int key_length, zend_accel_hash_entry *bucket)
{
if (!zend_accel_hash_str_find(&ZCSG(hash), key, key_length)) {
if (zend_accel_hash_is_full(&ZCSG(hash))) {
}
#endif
-static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int *from_shared_memory)
+static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, const char *key, unsigned int key_length, int *from_shared_memory)
{
zend_accel_hash_entry *bucket;
uint32_t memory_used;
}
}
-static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handle, int type, char *key, zend_op_array **op_array_p)
+static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handle, int type, const char *key, zend_op_array **op_array_p)
{
zend_persistent_script *new_persistent_script;
zend_op_array *orig_active_op_array;
* 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, uint32_t key_length, zend_bool indirect, void *data)
+zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, const char *key, uint32_t key_length, zend_bool indirect, void *data)
{
zend_ulong hash_value;
zend_ulong index;
return entry;
}
-static zend_always_inline void* zend_accel_hash_find_ex(zend_accel_hash *accel_hash, char *key, uint32_t key_length, zend_ulong hash_value, int data)
+static zend_always_inline void* zend_accel_hash_find_ex(zend_accel_hash *accel_hash, const char *key, uint32_t key_length, zend_ulong hash_value, int data)
{
zend_ulong index;
zend_accel_hash_entry *entry;
/* Returns the data associated with key on success
* Returns NULL if data doesn't exist
*/
-void* zend_accel_hash_str_find(zend_accel_hash *accel_hash, char *key, uint32_t key_length)
+void* zend_accel_hash_str_find(zend_accel_hash *accel_hash, const char *key, uint32_t key_length)
{
return zend_accel_hash_find_ex(
accel_hash,
/* Returns the hash entry associated with key on success
* Returns NULL if it doesn't exist
*/
-zend_accel_hash_entry* zend_accel_hash_str_find_entry(zend_accel_hash *accel_hash, char *key, uint32_t key_length)
+zend_accel_hash_entry* zend_accel_hash_str_find_entry(zend_accel_hash *accel_hash, const char *key, uint32_t key_length)
{
return (zend_accel_hash_entry *)zend_accel_hash_find_ex(
accel_hash,
0);
}
-int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, uint32_t key_length)
+int zend_accel_hash_unlink(zend_accel_hash *accel_hash, const char *key, uint32_t key_length)
{
zend_ulong hash_value;
zend_ulong index;
struct _zend_accel_hash_entry {
zend_ulong hash_value;
- char *key;
+ const char *key;
uint32_t key_length;
zend_accel_hash_entry *next;
void *data;
zend_accel_hash_entry* zend_accel_hash_update(
zend_accel_hash *accel_hash,
- char *key,
+ const char *key,
uint32_t key_length,
zend_bool indirect,
void *data);
void* zend_accel_hash_str_find(
zend_accel_hash *accel_hash,
- char *key,
+ const char *key,
uint32_t key_length);
zend_accel_hash_entry* zend_accel_hash_str_find_entry(
zend_accel_hash *accel_hash,
- char *key,
+ const char *key,
uint32_t key_length);
int zend_accel_hash_unlink(
zend_accel_hash *accel_hash,
- char *key,
+ const char *key,
uint32_t key_length);
static inline zend_bool zend_accel_hash_is_full(zend_accel_hash *accel_hash)
zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce);
}
-zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length)
+zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, const char **key, unsigned int key_length)
{
script->mem = ZCG(mem);
#define ZEND_PERSIST_H
int zend_accel_script_persistable(zend_persistent_script *script);
-uint32_t zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length, int for_shm);
-zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length);
+uint32_t zend_accel_script_persist_calc(zend_persistent_script *script, const char *key, unsigned int key_length, int for_shm);
+zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, const char **key, unsigned int key_length);
#endif /* ZEND_PERSIST_H */
zend_hash_persist_calc(class_table, zend_persist_class_entry_calc);
}
-uint32_t zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int for_shm)
+uint32_t zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, const char *key, unsigned int key_length, int for_shm)
{
new_persistent_script->mem = NULL;
new_persistent_script->size = 0;