Skip to content

Commit

Permalink
Use Zend MM for JIT temporary buffres allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Apr 1, 2019
1 parent e9c49b7 commit 6fccca5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ext/opcache/jit/zend_jit.c
Expand Up @@ -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"

Expand Down

0 comments on commit 6fccca5

Please sign in to comment.