com php-src: Use Zend MM for JIT temporary buffres allocation: ext/opcache/jit/zend_jit.c
| From: | Dmitry Stogov | Date: | Mon, 01 Apr 2019 16:22:22 +0000 |
| Subject: | com php-src: Use Zend MM for JIT temporary buffres allocation: ext/opcache/jit/zend_jit.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105452@lists.php.net to get a copy of this message | ||
Commit: 6fccca54a20c34c972f0c98db17462a63189715e
Author: Dmitry Stogov <dmitry@zend.com> Mon, 1 Apr 2019 19:22:22 +0300
Parents: e9c49b73b7d65d40e7345353426da144cd063d01
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6fccca54a20c34c972f0c98db17462a63189715e
Log:
Use Zend MM for JIT temporary buffres allocation
Changed paths:
M ext/opcache/jit/zend_jit.c
Diff:
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index 194e738..d8e441c 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -50,7 +50,18 @@
#define JIT_PREFIX "JIT$"
#define JIT_STUB_PREFIX "JIT$$"
-// TODO: define DASM_M_GROW and DASM_M_FREE to use CG(arena) ???
+#define DASM_M_GROW(ctx, t, p, sz, need) \
+ do { \
+ size_t _sz = (sz), _need = (need); \
+ if (_sz < _need) { \
+ if (_sz < 16) _sz = 16; \
+ while (_sz < _need) _sz += _sz; \
+ (p) = (t *)erealloc((p), _sz); \
+ (sz) = _sz; \
+ } \
+ } while(0)
+
+#define DASM_M_FREE(ctx, p, sz) efree(p)
#include "dynasm/dasm_proto.h"