Merge branch 'PHP-7.4'

This commit is contained in:
Nikita Popov 2019-04-10 15:31:24 +02:00
commit 9db2efe283
2 changed files with 23 additions and 0 deletions

View file

@ -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
}