Lines Matching refs:ZCG

210 		if (ZCG(cwd)) {  in ZEND_FUNCTION()
211 zend_string_release_ex(ZCG(cwd), 0); in ZEND_FUNCTION()
213 ZCG(cwd) = zend_string_init(cwd, strlen(cwd), 0); in ZEND_FUNCTION()
215 if (ZCG(cwd)) { in ZEND_FUNCTION()
216 zend_string_release_ex(ZCG(cwd), 0); in ZEND_FUNCTION()
217 ZCG(cwd) = NULL; in ZEND_FUNCTION()
220 ZCG(cwd_key_len) = 0; in ZEND_FUNCTION()
221 ZCG(cwd_check) = true; in ZEND_FUNCTION()
226 if (ZCG(cwd)) { in accel_getcwd()
227 return ZCG(cwd); in accel_getcwd()
234 ZCG(cwd) = zend_string_init(cwd, strlen(cwd), 0); in accel_getcwd()
235 ZCG(cwd_key_len) = 0; in accel_getcwd()
236 ZCG(cwd_check) = true; in accel_getcwd()
237 return ZCG(cwd); in accel_getcwd()
243 …if ((((double) ZSMMG(wasted_shared_memory)) / ZCG(accel_directives).memory_consumption) >= ZCG(acc… in zend_accel_schedule_restart_if_necessary()
258 ZCG(include_path) = new_value; in ZEND_INI_MH()
259 ZCG(include_path_key_len) = 0; in ZEND_INI_MH()
260 ZCG(include_path_check) = true; in ZEND_INI_MH()
359 if (ZCG(counted)) { in accel_deactivate_sub()
362 ZCG(counted) = false; in accel_deactivate_sub()
480 if (!ZCG(counted)) { in accel_find_interned_string()
481 if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) { in accel_find_interned_string()
484 ZCG(counted) = true; in accel_find_interned_string()
569 if (ZCG(counted)) { in accel_new_interned_string_for_php()
601 if (ZCG(counted)) { in accel_init_interned_string_for_php()
815 ZCG(counted) = true; in accel_use_shm_interned_strings()
817 ZCG(counted) = false; in accel_use_shm_interned_strings()
920 if (ZCG(accel_directives).force_restart_timeout in accel_is_inactive()
923 …at %ld (after " ZEND_LONG_FMT " seconds), locked by %d", (long)time(NULL), ZCG(accel_directives).f… in accel_is_inactive()
1167 } else if (ZCG(accel_directives).revalidate_freq && in validate_timestamp_and_record()
1168 persistent_script->dynamic_members.revalidate >= ZCG(request_time)) { in validate_timestamp_and_record()
1173 …persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalida… in validate_timestamp_and_record()
1197 ZSTR_LEN(&ZCG(key)) = 0; in accel_make_persistent_key()
1207 } else if (UNEXPECTED(!ZCG(accel_directives).use_cwd)) { in accel_make_persistent_key()
1215 if (EXPECTED(ZCG(cwd_key_len))) { in accel_make_persistent_key()
1216 cwd = ZCG(cwd_key); in accel_make_persistent_key()
1217 cwd_len = ZCG(cwd_key_len); in accel_make_persistent_key()
1228 if (ZCG(cwd_check)) { in accel_make_persistent_key()
1229 ZCG(cwd_check) = false; in accel_make_persistent_key()
1230 if (ZCG(accelerator_enabled)) { in accel_make_persistent_key()
1250 cwd_len = ZCG(cwd_key_len) = buf + sizeof(buf) - 1 - res; in accel_make_persistent_key()
1251 cwd = ZCG(cwd_key); in accel_make_persistent_key()
1252 memcpy(ZCG(cwd_key), res, cwd_len + 1); in accel_make_persistent_key()
1262 if (EXPECTED(ZCG(include_path_key_len))) { in accel_make_persistent_key()
1263 include_path = ZCG(include_path_key); in accel_make_persistent_key()
1264 include_path_len = ZCG(include_path_key_len); in accel_make_persistent_key()
1265 } else if (!ZCG(include_path) || ZSTR_LEN(ZCG(include_path)) == 0) { in accel_make_persistent_key()
1269 include_path = ZSTR_VAL(ZCG(include_path)); in accel_make_persistent_key()
1270 include_path_len = ZSTR_LEN(ZCG(include_path)); in accel_make_persistent_key()
1272 if (ZCG(include_path_check)) { in accel_make_persistent_key()
1273 ZCG(include_path_check) = false; in accel_make_persistent_key()
1274 if (ZCG(accelerator_enabled)) { in accel_make_persistent_key()
1276 zend_string *str = accel_find_interned_string(ZCG(include_path)); in accel_make_persistent_key()
1281 str = accel_new_interned_string(zend_string_copy(ZCG(include_path))); in accel_make_persistent_key()
1282 if (str == ZCG(include_path)) { in accel_make_persistent_key()
1294 include_path_len = ZCG(include_path_key_len) = buf + sizeof(buf) - 1 - res; in accel_make_persistent_key()
1295 include_path = ZCG(include_path_key); in accel_make_persistent_key()
1296 memcpy(ZCG(include_path_key), res, include_path_len + 1); in accel_make_persistent_key()
1307 if (UNEXPECTED((size_t)(cwd_len + path_length + include_path_len + 2) >= sizeof(ZCG(_key)))) { in accel_make_persistent_key()
1316 key = ZSTR_VAL(&ZCG(key)); in accel_make_persistent_key()
1340 if (UNEXPECTED((size_t)(key_length + parent_script_len + 1) >= sizeof(ZCG(_key)))) { in accel_make_persistent_key()
1349 GC_SET_REFCOUNT(&ZCG(key), 1); in accel_make_persistent_key()
1350 GC_TYPE_INFO(&ZCG(key)) = GC_STRING; in accel_make_persistent_key()
1351 ZSTR_H(&ZCG(key)) = 0; in accel_make_persistent_key()
1352 ZSTR_LEN(&ZCG(key)) = key_length; in accel_make_persistent_key()
1353 return &ZCG(key); in accel_make_persistent_key()
1400 if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) { in zend_accel_invalidate()
1413 if (ZCG(accel_directives).file_cache) { in zend_accel_invalidate()
1424 !ZCG(accel_directives).validate_timestamps || in zend_accel_invalidate()
1507 ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 64); in store_script_in_file_cache()
1508 ZCG(mem) = (void*)(((uintptr_t)ZCG(mem) + 63L) & ~63L); in store_script_in_file_cache()
1511 ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 8); in store_script_in_file_cache()
1512 ZCG(mem) = (void*)(((uintptr_t)ZCG(mem) + 7L) & ~7L); in store_script_in_file_cache()
1514 ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used); in store_script_in_file_cache()
1527 if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) { in store_script_in_file_cache()
1529 …((char*)new_persistent_script->mem + new_persistent_script->size < (char*)ZCG(mem)) ? ACCEL_LOG_ER… in store_script_in_file_cache()
1534 (size_t)ZCG(mem)); in store_script_in_file_cache()
1548 …zend_optimize_script(&new_persistent_script->script, ZCG(accel_directives).optimization_level, ZCG in cache_script_in_file_cache()
1563 if (ZCG(accel_directives).file_cache) { in cache_script_in_shared_memory()
1566 …zend_optimize_script(&new_persistent_script->script, ZCG(accel_directives).optimization_level, ZCG in cache_script_in_shared_memory()
1582 (!ZCG(accel_directives).validate_timestamps || in cache_script_in_shared_memory()
1603 if (ZCG(accel_directives).file_cache) { in cache_script_in_shared_memory()
1616 ZCG(mem) = zend_shared_alloc_aligned(memory_used); in cache_script_in_shared_memory()
1617 if (!ZCG(mem)) { in cache_script_in_shared_memory()
1621 if (ZCG(accel_directives).file_cache) { in cache_script_in_shared_memory()
1628 bzero_aligned(ZCG(mem), memory_used); in cache_script_in_shared_memory()
1640 if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) { in cache_script_in_shared_memory()
1642 …((char*)new_persistent_script->mem + new_persistent_script->size < (char*)ZCG(mem)) ? ACCEL_LOG_ER… in cache_script_in_shared_memory()
1647 (size_t)ZCG(mem)); in cache_script_in_shared_memory()
1679 if (ZCG(accel_directives).file_cache) { in cache_script_in_shared_memory()
1719 ZCG(auto_globals_mask) |= mask; in zend_accel_set_auto_globals()
1764 if (ZCG(accel_directives).validate_timestamps || in opcache_compile_file()
1765 ZCG(accel_directives).file_update_protection || in opcache_compile_file()
1766 ZCG(accel_directives).max_file_size > 0) { in opcache_compile_file()
1772 …timestamp = zend_get_file_handle_timestamp(file_handle, ZCG(accel_directives).max_file_size > 0 ? … in opcache_compile_file()
1783 if (ZCG(accel_directives).file_update_protection && in opcache_compile_file()
1784 … ((accel_time_t)(ZCG(request_time) - ZCG(accel_directives).file_update_protection) < timestamp)) { in opcache_compile_file()
1789 …if (ZCG(accel_directives).max_file_size > 0 && size > (size_t)ZCG(accel_directives).max_file_size)… in opcache_compile_file()
1806 if (ZCG(accel_directives).record_warnings) { in opcache_compile_file()
1822 if (ZCG(accel_directives).file_cache) { in opcache_compile_file()
1872 if (ZCG(accel_directives).validate_timestamps) { in opcache_compile_file()
1877 …new_persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).reva… in opcache_compile_file()
1946 if (persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)) { in file_cache_compile_file()
1947 zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)); in file_cache_compile_file()
1992 if (!file_handle->filename || !ZCG(accelerator_enabled)) { in persistent_compile_file()
1994 ZCG(cache_opline) = NULL; in persistent_compile_file()
1995 ZCG(cache_persistent_script) = NULL; in persistent_compile_file()
1997 && ZCG(accel_directives).file_cache in persistent_compile_file()
1998 && ZCG(enabled) && accel_startup_ok) { in persistent_compile_file()
2003 ZCG(cache_opline) = NULL; in persistent_compile_file()
2004 ZCG(cache_persistent_script) = NULL; in persistent_compile_file()
2007 if (ZCG(accel_directives).file_cache) { in persistent_compile_file()
2010 ZCG(cache_opline) = NULL; in persistent_compile_file()
2011 ZCG(cache_persistent_script) = NULL; in persistent_compile_file()
2018 if (ZCG(cache_persistent_script) && in persistent_compile_file()
2021 ZCG(cache_opline) == NULL) || in persistent_compile_file()
2025 ZCG(cache_opline) == EG(current_execute_data)->opline))) { in persistent_compile_file()
2027 persistent_script = ZCG(cache_persistent_script); in persistent_compile_file()
2028 if (ZSTR_LEN(&ZCG(key))) { in persistent_compile_file()
2029 key = &ZCG(key); in persistent_compile_file()
2033 if (!ZCG(accel_directives).revalidate_path) { in persistent_compile_file()
2037 ZCG(cache_opline) = NULL; in persistent_compile_file()
2038 ZCG(cache_persistent_script) = NULL; in persistent_compile_file()
2043 ZCG(cache_opline) = NULL; in persistent_compile_file()
2044 ZCG(cache_persistent_script) = NULL; in persistent_compile_file()
2086 ZCG(cache_opline) = NULL; in persistent_compile_file()
2087 ZCG(cache_persistent_script) = NULL; in persistent_compile_file()
2097 if (!ZCG(counted)) { in persistent_compile_file()
2099 if (ZCG(accel_directives).file_cache) { in persistent_compile_file()
2104 ZCG(counted) = true; in persistent_compile_file()
2109 UNEXPECTED(ZCG(accel_directives).validate_permission) && in persistent_compile_file()
2126 if (persistent_script && ZCG(accel_directives).validate_timestamps) { in persistent_compile_file()
2134 if (!persistent_script && ZCG(accel_directives).file_cache) { in persistent_compile_file()
2150 if (ZCG(accel_directives).file_cache) { in persistent_compile_file()
2186 persistent_script->dynamic_members.last_used = ZCG(request_time); in persistent_compile_file()
2227 persistent_script->dynamic_members.last_used = ZCG(request_time); in persistent_compile_file()
2236 if (persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)) { in persistent_compile_file()
2237 zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)); in persistent_compile_file()
2334 if (!ZCG(accelerator_enabled) || in zend_accel_inheritance_cache_add()
2375 ZCG(current_persistent_script) = &dummy; in zend_accel_inheritance_cache_add()
2384 ZCG(mem) = zend_shared_alloc(size + 8); in zend_accel_inheritance_cache_add()
2386 ZCG(mem) = zend_shared_alloc(size); in zend_accel_inheritance_cache_add()
2389 if (!ZCG(mem)) { in zend_accel_inheritance_cache_add()
2400 ZCG(mem) = (void*)(((uintptr_t)ZCG(mem) + 7L) & ~7L); in zend_accel_inheritance_cache_add()
2403 memset(ZCG(mem), 0, size); in zend_accel_inheritance_cache_add()
2404 entry = (zend_inheritance_cache_entry*)ZCG(mem); in zend_accel_inheritance_cache_add()
2405 ZCG(mem) = (char*)ZCG(mem) + in zend_accel_inheritance_cache_add()
2420 entry->dependencies = (zend_class_dependency*)ZCG(mem); in zend_accel_inheritance_cache_add()
2429 ZCG(mem) = (char*)ZCG(mem) + zend_hash_num_elements(dependencies) * sizeof(zend_class_dependency); in zend_accel_inheritance_cache_add()
2463 if ((char*)entry + size != (char*)ZCG(mem)) { in zend_accel_inheritance_cache_add()
2465 ((char*)entry + size < (char*)ZCG(mem)) ? ACCEL_LOG_ERROR : ACCEL_LOG_WARNING, in zend_accel_inheritance_cache_add()
2470 (size_t)ZCG(mem)); in zend_accel_inheritance_cache_add()
2491 PHP_MD5Update(&ctx, ZCG(accel_directives).cache_id, strlen(ZCG(accel_directives).cache_id)); in accel_gen_uname_id()
2501 if (ZCG(cache_persistent_script)) { in persistent_stream_open_function()
2505 ZCG(cache_opline) == NULL) || in persistent_stream_open_function()
2509 ZCG(cache_opline) == EG(current_execute_data)->opline)) { in persistent_stream_open_function()
2512 handle->opened_path = zend_string_copy(ZCG(cache_persistent_script)->script.filename); in persistent_stream_open_function()
2515 ZCG(cache_opline) = NULL; in persistent_stream_open_function()
2516 ZCG(cache_persistent_script) = NULL; in persistent_stream_open_function()
2525 ZCG(accelerator_enabled)) { in persistent_zend_resolve_path()
2540 if (!ZCG(accel_directives).revalidate_path) { in persistent_zend_resolve_path()
2548 ZCG(cache_opline) = EG(current_execute_data) ? EG(current_execute_data)->opline : NULL; in persistent_zend_resolve_path()
2549 ZCG(cache_persistent_script) = persistent_script; in persistent_zend_resolve_path()
2554 ZCG(cache_opline) = NULL; in persistent_zend_resolve_path()
2555 ZCG(cache_persistent_script) = NULL; in persistent_zend_resolve_path()
2579 ZSTR_LEN(&ZCG(key)) = 0; in persistent_zend_resolve_path()
2581 ZCG(cache_opline) = EG(current_execute_data) ? EG(current_execute_data)->opline : NULL; in persistent_zend_resolve_path()
2582 ZCG(cache_persistent_script) = persistent_script; in persistent_zend_resolve_path()
2588 ZCG(cache_opline) = NULL; in persistent_zend_resolve_path()
2589 ZCG(cache_persistent_script) = NULL; in persistent_zend_resolve_path()
2593 ZCG(cache_opline) = NULL; in persistent_zend_resolve_path()
2594 ZCG(cache_persistent_script) = NULL; in persistent_zend_resolve_path()
2625 if (!ZCG(enabled) || !accel_startup_ok) { in accel_activate()
2626 ZCG(accelerator_enabled) = false; in accel_activate()
2631 ZCG(auto_globals_mask) = 0; in accel_activate()
2632 ZCG(request_time) = (time_t)sapi_get_request_time(); in accel_activate()
2633 ZCG(cache_opline) = NULL; in accel_activate()
2634 ZCG(cache_persistent_script) = NULL; in accel_activate()
2635 ZCG(include_path_key_len) = 0; in accel_activate()
2636 ZCG(include_path_check) = true; in accel_activate()
2638 ZCG(cwd) = NULL; in accel_activate()
2639 ZCG(cwd_key_len) = 0; in accel_activate()
2640 ZCG(cwd_check) = true; in accel_activate()
2643 ZCG(accelerator_enabled) = false; in accel_activate()
2648 if (ZCG(accel_directives).validate_root) { in accel_activate()
2652 ZCG(root_hash) = 0; in accel_activate()
2654 ZCG(root_hash) = buf.st_ino; in accel_activate()
2655 if (sizeof(buf.st_ino) > sizeof(ZCG(root_hash))) { in accel_activate()
2656 if (ZCG(root_hash) != buf.st_ino) { in accel_activate()
2666 ZCG(root_hash) = 0; in accel_activate()
2673 if (ZCG(counted)) { in accel_activate()
2680 ZCG(counted) = false; in accel_activate()
2706 if (ZCG(accel_directives).interned_strings_buffer) { in accel_activate()
2720 if (ZCSG(last_restart_time) < ZCG(request_time)) { in accel_activate()
2721 ZCSG(last_restart_time) = ZCG(request_time); in accel_activate()
2731 ZCG(accelerator_enabled) = ZCSG(accelerator_enabled); in accel_activate()
2736 if (ZCG(accelerator_enabled) && ZCSG(last_restart_time) != ZCG(last_restart_time)) { in accel_activate()
2738 ZCG(last_restart_time) = ZCSG(last_restart_time); in accel_activate()
2744 ZCG(pcre_reseted) = false; in accel_activate()
2745 } else if (!ZCG(accelerator_enabled) && !ZCG(pcre_reseted)) { in accel_activate()
2747 ZCG(pcre_reseted) = true; in accel_activate()
2771 if (ZCG(cwd)) { in accel_post_deactivate()
2772 zend_string_release_ex(ZCG(cwd), 0); in accel_post_deactivate()
2773 ZCG(cwd) = NULL; in accel_post_deactivate()
2776 if (!ZCG(enabled) || !accel_startup_ok) { in accel_post_deactivate()
2782 ZCG(counted) = false; in accel_post_deactivate()
2843 if (ZCG(accel_directives).enable_cli && ( in accel_find_sapi()
2860 if (ZCG(accel_directives).interned_strings_buffer) { in zend_accel_init_shm()
2861 …accel_shared_globals_size = sizeof(zend_accel_shared_globals) + ZCG(accel_directives).interned_str… in zend_accel_init_shm()
2879 zend_accel_hash_init(&ZCSG(hash), ZCG(accel_directives).max_accelerated_files); in zend_accel_init_shm()
2881 if (ZCG(accel_directives).interned_strings_buffer) { in zend_accel_init_shm()
2885 hash_size = ZCG(accel_directives).interned_strings_buffer * (32 * 1024); in zend_accel_init_shm()
2906 ZCG(accel_directives).interned_strings_buffer * 1024 * 1024); in zend_accel_init_shm()
3156 if (ZCG(accel_directives).huge_code_pages && in accel_startup()
3168 if (!ZCG(accel_directives).enable_cli && in accel_startup()
3177 if (ZCG(enabled) == 0) { in accel_startup()
3207 file_cache_only = ZCG(accel_directives).file_cache_only;
3209 size_t shm_size = ZCG(accel_directives).memory_consumption;
3273 ZCG(last_restart_time) = ZCSG(last_restart_time);
3292 } else if (!ZCG(accel_directives).file_cache) {
3327 ZCG(cwd) = NULL;
3328 ZCG(include_path) = NULL;
3332 ZCG(include_path) = ini_entry->value;
3344 if (ZCG(enabled) && accel_startup_ok &&
3345 ZCG(accel_directives).user_blacklist_filename &&
3346 *ZCG(accel_directives.user_blacklist_filename)) {
3348 zend_accel_blacklist_load(&accel_blacklist, ZCG(accel_directives.user_blacklist_filename));
3351 if (!file_cache_only && ZCG(accel_directives).interned_strings_buffer) {
3359 if (ZCG(enabled) && accel_startup_ok) {
3388 if (!ZCG(enabled) || !accel_startup_ok) {
3449 if (ZCG(accel_directives).force_restart_timeout) {
3450 ZCSG(force_restart_time) = zend_accel_get_time() + ZCG(accel_directives).force_restart_timeout;
3462 ZCG(counted) = true;
3474 if (ZCG(counted)) {
3489 ZCG(counted) = true;
3497 if (!ZCG(counted)) {
3543 if (ZCSG(preload_script)->ping_auto_globals_mask & ~ZCG(auto_globals_mask)) {
3544 …zend_accel_set_auto_globals(ZCSG(preload_script)->ping_auto_globals_mask & ~ZCG(auto_globals_mask)…
4227 …zend_optimize_script(&script->script, ZCG(accel_directives).optimization_level, ZCG(accel_directiv…
4243 …zend_optimize_script(&script->script, ZCG(accel_directives).optimization_level, ZCG(accel_directiv…
4265 ZCG(mem) = zend_shared_alloc_aligned(memory_used);
4266 if (!ZCG(mem)) {
4271 bzero_aligned(ZCG(mem), memory_used);
4281 if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) {
4283 …((char*)new_persistent_script->mem + new_persistent_script->size < (char*)ZCG(mem)) ? ACCEL_LOG_ER…
4288 (size_t)ZCG(mem));
4356 ZCG(enabled) = false;
4357 ZCG(accelerator_enabled) = false;
4421 ZCG(enabled) = true;
4647 ZCG(auto_globals_mask) = 0;
4648 ZCG(request_time) = (time_t)sapi_get_request_time();
4649 ZCG(cache_opline) = NULL;
4650 ZCG(cache_persistent_script) = NULL;
4651 ZCG(include_path_key_len) = 0;
4652 ZCG(include_path_check) = true;
4654 ZCG(cwd) = NULL;
4655 ZCG(cwd_key_len) = 0;
4656 ZCG(cwd_check) = true;
4658 if (accel_preload(ZCG(accel_directives).preload, in_child) != SUCCESS) {
4701 if (ZCG(accel_directives).preload_user
4702 && *ZCG(accel_directives).preload_user) {
4710 if (!ZCG(accel_directives).preload_user
4711 || !*ZCG(accel_directives).preload_user) {
4726 struct passwd *pw = getpwnam(ZCG(accel_directives).preload_user);
4729 …zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Preloading failed to getpwnam(\"%s\")", ZCG(accel_dire…
4766 if (!ZCG(enabled) || !accel_startup_ok) {
4770 if (!(ZCG(accel_directives).preload && *ZCG(accel_directives).preload)) {