static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
#ifdef ZEND_WIN32
-# define INCREMENT(v) InterlockedIncrement(&ZCSG(v))
-# define DECREMENT(v) InterlockedDecrement(&ZCSG(v))
+# define INCREMENT(v) InterlockedIncrement64(&ZCSG(v))
+# define DECREMENT(v) InterlockedDecrement64(&ZCSG(v))
# define LOCKVAL(v) (ZCSG(v))
#endif
switch (file_handle->type) {
case ZEND_HANDLE_FD:
- if (fstat(file_handle->handle.fd, &statbuf) == -1) {
+ if (zend_fstat(file_handle->handle.fd, &statbuf) == -1) {
return 0;
}
break;
case ZEND_HANDLE_FP:
- if (fstat(fileno(file_handle->handle.fp), &statbuf) == -1) {
+ if (zend_fstat(fileno(file_handle->handle.fp), &statbuf) == -1) {
if (zend_get_stream_timestamp(file_handle->filename, &statbuf TSRMLS_CC) != SUCCESS) {
return 0;
}
ZCSG(hits)++; /* TBFixed: may lose one hit */
persistent_script->dynamic_members.hits++; /* see above */
#else
- InterlockedIncrement(&ZCSG(hits));
- InterlockedIncrement(&persistent_script->dynamic_members.hits);
+ INCREMENT(hits);
+ InterlockedIncrement64(&persistent_script->dynamic_members.hits);
#endif
/* see bug #15471 (old BTS) */
*/
struct zend_persistent_script_dynamic_members {
time_t last_used;
+#ifdef ZEND_WIN32
+ LONGLONG hits;
+#else
zend_uint_t hits;
+#endif
unsigned int memory_consumption;
unsigned int checksum;
time_t revalidate;
zend_accel_restart_reason restart_reason;
zend_bool cache_status_before_restart;
#ifdef ZEND_WIN32
- zend_uint_t mem_usage;
- zend_uint_t restart_in;
+ LONGLONG mem_usage;
+ LONGLONG restart_in;
#endif
zend_bool restart_in_progress;
time_t revalidate_at;
char buf[32];
php_info_print_table_row(2, "Startup", "OK");
php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model());
- snprintf(buf, sizeof(buf), ZEND_UINT_FMT, ZCSG(hits));
+ snprintf(buf, sizeof(buf), ZEND_UINT_FMT, (zend_uint_t)ZCSG(hits));
php_info_print_table_row(2, "Cache hits", buf);
snprintf(buf, sizeof(buf), "%pd", ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses));
php_info_print_table_row(2, "Cache misses", buf);
array_init(&persistent_script_report);
add_assoc_str(&persistent_script_report, "full_path", STR_DUP(script->full_path, 0));
- add_assoc_int(&persistent_script_report, "hits", script->dynamic_members.hits);
+ add_assoc_int(&persistent_script_report, "hits", (zend_int_t)script->dynamic_members.hits);
add_assoc_int(&persistent_script_report, "memory_consumption", script->dynamic_members.memory_consumption);
ta = localtime(&script->dynamic_members.last_used);
str = asctime(ta);
add_assoc_int(&statistics, "num_cached_scripts", ZCSG(hash).num_direct_entries);
add_assoc_int(&statistics, "num_cached_keys", ZCSG(hash).num_entries);
add_assoc_int(&statistics, "max_cached_keys", ZCSG(hash).max_num_entries);
- add_assoc_int(&statistics, "hits", ZCSG(hits));
+ add_assoc_int(&statistics, "hits", (zend_int_t)ZCSG(hits));
add_assoc_int(&statistics, "start_time", ZCSG(start_time));
add_assoc_int(&statistics, "last_restart_time", ZCSG(last_restart_time));
add_assoc_int(&statistics, "oom_restarts", ZCSG(oom_restarts));
if (!val) {
val = "";
}
- if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), (unsigned int *)&new_val_len TSRMLS_CC)) {
+ if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), (php_size_t *)&new_val_len TSRMLS_CC)) {
php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC);
}
APR_ARRAY_FOREACH_CLOSE()
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), (unsigned int *)&new_val_len TSRMLS_CC)) {
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), (php_size_t *)&new_val_len TSRMLS_CC)) {
php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC);
}
}
return SUCCESS;
}
-static inline size_t php_embed_single_write(const char *str, uint str_length)
+static inline size_t php_embed_single_write(const char *str, php_size_t str_length)
{
#ifdef PHP_WRITE_STDOUT
- long ret;
+ php_int_t ret;
ret = write(STDOUT_FILENO, str, str_length);
if (ret <= 0) return 0;
}
-static int php_embed_ub_write(const char *str, uint str_length TSRMLS_DC)
+static php_size_t php_embed_ub_write(const char *str, php_size_t str_length TSRMLS_DC)
{
const char *ptr = str;
- uint remaining = str_length;
+ php_size_t remaining = str_length;
size_t ret;
while (remaining > 0) {