mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Prefer already cached version of the script
This commit is contained in:
parent
3b62e8b9ab
commit
95248491af
2 changed files with 9 additions and 0 deletions
|
@ -1471,7 +1471,14 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
|
||||||
zend_accel_add_key(key, key_length, bucket);
|
zend_accel_add_key(key, key_length, bucket);
|
||||||
}
|
}
|
||||||
zend_shared_alloc_unlock();
|
zend_shared_alloc_unlock();
|
||||||
|
#if 1
|
||||||
|
/* prefer the script already stored in SHM */
|
||||||
|
free_persistent_script(new_persistent_script, 1);
|
||||||
|
*from_shared_memory = 1;
|
||||||
|
return existing_persistent_script;
|
||||||
|
#else
|
||||||
return new_persistent_script;
|
return new_persistent_script;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,8 @@ void free_persistent_script(zend_persistent_script *persistent_script, int destr
|
||||||
if (!destroy_elements) {
|
if (!destroy_elements) {
|
||||||
persistent_script->script.function_table.pDestructor = NULL;
|
persistent_script->script.function_table.pDestructor = NULL;
|
||||||
persistent_script->script.class_table.pDestructor = NULL;
|
persistent_script->script.class_table.pDestructor = NULL;
|
||||||
|
} else {
|
||||||
|
destroy_op_array(&persistent_script->script.main_op_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_hash_destroy(&persistent_script->script.function_table);
|
zend_hash_destroy(&persistent_script->script.function_table);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue