summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_shared_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/zend_shared_alloc.c')
-rw-r--r--ext/opcache/zend_shared_alloc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c
index d616c7d62f..deae886991 100644
--- a/ext/opcache/zend_shared_alloc.c
+++ b/ext/opcache/zend_shared_alloc.c
@@ -507,3 +507,20 @@ void zend_accel_shared_protect(int mode)
}
#endif
}
+
+int zend_accel_in_shm(void *ptr)
+{
+ int i;
+
+ if (!smm_shared_globals) {
+ return 0;
+ }
+
+ for (i = 0; i < ZSMMG(shared_segments_count); i++) {
+ if ((char*)ptr >= (char*)ZSMMG(shared_segments)[i]->p &&
+ (char*)ptr < (char*)ZSMMG(shared_segments)[i]->p + ZSMMG(shared_segments)[i]->size) {
+ return 1;
+ }
+ }
+ return 0;
+}