Skip to content

Instantly share code, notes, and snippets.

@weltling
Created March 26, 2019 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weltling/9f4c6eb5a28f1f8ad86c3427db943e4e to your computer and use it in GitHub Desktop.
Save weltling/9f4c6eb5a28f1f8ad86c3427db943e4e to your computer and use it in GitHub Desktop.
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -305,7 +305,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;
@@ -327,8 +329,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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment