mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Merge branch 'PHP-7.4'
This commit is contained in:
@@ -309,7 +309,9 @@ static inline int accel_restart_is_active(void)
|
||||
static inline int accel_activate_add(void)
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
SHM_UNPROTECT();
|
||||
INCREMENT(mem_usage);
|
||||
SHM_PROTECT();
|
||||
#else
|
||||
struct flock mem_usage_lock;
|
||||
|
||||
@@ -331,8 +333,10 @@ static inline void accel_deactivate_sub(void)
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
if (ZCG(counted)) {
|
||||
SHM_UNPROTECT();
|
||||
DECREMENT(mem_usage);
|
||||
ZCG(counted) = 0;
|
||||
SHM_PROTECT();
|
||||
}
|
||||
#else
|
||||
struct flock mem_usage_unlock;
|
||||
|
||||
@@ -611,6 +611,25 @@ void zend_accel_shared_protect(int mode)
|
||||
for (i = 0; i < ZSMMG(shared_segments_count); i++) {
|
||||
mprotect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->end, mode);
|
||||
}
|
||||
#elif defined(ZEND_WIN32)
|
||||
int i;
|
||||
|
||||
if (!smm_shared_globals) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode) {
|
||||
mode = PAGE_READONLY;
|
||||
} else {
|
||||
mode = PAGE_READWRITE;
|
||||
}
|
||||
|
||||
for (i = 0; i < ZSMMG(shared_segments_count); i++) {
|
||||
DWORD oldProtect;
|
||||
if (!VirtualProtect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->size, mode, &oldProtect)) {
|
||||
zend_accel_error(ACCEL_LOG_ERROR, "Failed to protect memory");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user