diff options
author | Kimmo Ollila <kimmo.ollila@qt.io> | 2017-02-04 15:12:54 +0200 |
---|---|---|
committer | Kimmo Ollila <kimmo.ollila@qt.io> | 2017-02-15 10:27:39 +0000 |
commit | 87f016ea9eddc874d5cba7d79d0a487d5ef61761 (patch) | |
tree | c3507781ff1302c96bcd4f75200345643f1ed5db /src/qml/jit | |
parent | a5389f3189f70177407dfd67d8b1d43e7a6b580b (diff) |
Add Q_ALLOCA_VAR, Q_ALLOCA_DECLARE and Q_ALLOCA_ASSIGN macros
Define Q_ALLOCA_VAR macro to be used instead of #ifdeffing
the occurrences of alloca() in case it's not supported.
Q_ALLOCA_DECLARE and Q_ALLOCA_ASSIGN macros separate
memory allocation from the declaration and RAII.
Change-Id: Idc7551642c48a968a44bcade14d84800a3a1270e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r-- | src/qml/jit/qv4regalloc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp index d5da863ee0..e5abaa7458 100644 --- a/src/qml/jit/qv4regalloc.cpp +++ b/src/qml/jit/qv4regalloc.cpp @@ -1575,7 +1575,7 @@ static void longestAvailableReg(int *nextUses, int nextUseCount, int ®, int & #define CALLOC_ON_STACK(ty, ptr, sz, val) \ Q_ASSERT(sz > 0); \ - ty *ptr = reinterpret_cast<ty *>(alloca(sizeof(ty) * (sz))); \ + Q_ALLOCA_VAR(ty, ptr, sizeof(ty) * (sz)); \ for (ty *it = ptr, *eit = ptr + (sz); it != eit; ++it) \ *it = val; |