1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Don't enforce 64 hit counter on Windows

There is no particular need to have a 64bit hit counter on Windows.

Closes GH-9367.
This commit is contained in:
Christoph M. Becker
2022-08-18 15:17:31 +02:00
parent 66aed3a86f
commit 9313cd899e
3 changed files with 4 additions and 7 deletions

View File

@@ -2192,10 +2192,11 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
#else
#if ZEND_ENABLE_ZVAL_LONG64
InterlockedIncrement64(&ZCSG(hits));
InterlockedIncrement64(&persistent_script->dynamic_members.hits);
#else
InterlockedIncrement(&ZCSG(hits));
InterlockedIncrement(&persistent_script->dynamic_members.hits);
#endif
InterlockedIncrement64(&persistent_script->dynamic_members.hits);
#endif
/* see bug #15471 (old BTS) */

View File

@@ -137,11 +137,7 @@ typedef struct _zend_persistent_script {
*/
struct zend_persistent_script_dynamic_members {
time_t last_used;
#ifdef ZEND_WIN32
LONGLONG hits;
#else
zend_ulong hits;
#endif
zend_ulong hits;
unsigned int memory_consumption;
unsigned int checksum;
time_t revalidate;

View File

@@ -545,7 +545,7 @@ static int accelerator_get_scripts(zval *return_value)
array_init(&persistent_script_report);
add_assoc_str(&persistent_script_report, "full_path", zend_string_dup(script->script.filename, 0));
add_assoc_long(&persistent_script_report, "hits", (zend_long)script->dynamic_members.hits);
add_assoc_long(&persistent_script_report, "hits", script->dynamic_members.hits);
add_assoc_long(&persistent_script_report, "memory_consumption", script->dynamic_members.memory_consumption);
ta = localtime(&script->dynamic_members.last_used);
str = asctime(ta);