com php-src: Avoid code duplication: ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/jit/zend_jit.c
| From: | Anatol Belski | Date: | Thu, 11 Apr 2019 13:05:16 +0000 |
| Subject: | com php-src: Avoid code duplication: ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/jit/zend_jit.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105657@lists.php.net to get a copy of this message | ||
Commit: 853f881bd170e252537f3107ae2202f9832d78d4
Author: Anatol Belski <ab@php.net> Thu, 11 Apr 2019 14:44:57 +0200
Parents: 3e26a6bd546e0029794fd87cc564821e991e4136
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=853f881bd170e252537f3107ae2202f9832d78d4
Log:
Avoid code duplication
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/ZendAccelerator.h
M ext/opcache/jit/zend_jit.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 1dccc72..3b84d18 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -85,19 +85,6 @@ typedef int gid_t;
#include <immintrin.h>
#endif
-#define SHM_PROTECT() \
- do { \
- if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(1); \
- } \
- } while (0)
-#define SHM_UNPROTECT() \
- do { \
- if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(0); \
- } \
- } while (0)
-
ZEND_EXTENSION();
#ifndef ZTS
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 2ab786d..837898b 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -315,4 +315,19 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int
type);
zend_string* ZEND_FASTCALL accel_new_interned_string(zend_string *str);
+/* memory write protection */
+#define SHM_PROTECT() \
+ do { \
+ if (ZCG(accel_directives).protect_memory) { \
+ zend_accel_shared_protect(1); \
+ } \
+ } while (0)
+
+#define SHM_UNPROTECT() \
+ do { \
+ if (ZCG(accel_directives).protect_memory) { \
+ zend_accel_shared_protect(0); \
+ } \
+ } while (0)
+
#endif /* ZEND_ACCELERATOR_H */
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index 0472cc5..46c3b37 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -2644,21 +2644,6 @@ jit_failure:
return FAILURE;
}
-/* memory write protection */
-#define SHM_PROTECT() \
- do { \
- if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(1); \
- } \
- } while (0)
-
-#define SHM_UNPROTECT() \
- do { \
- if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(0); \
- } \
- } while (0)
-
/* Run-time JIT handler */
static void ZEND_FASTCALL zend_runtime_jit(void)
{