diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/alloc_func.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/alloc_func.hpp b/src/core/alloc_func.hpp index d5e90832e..ec30ffb6e 100644 --- a/src/core/alloc_func.hpp +++ b/src/core/alloc_func.hpp @@ -90,4 +90,7 @@ template <typename T> FORCEINLINE T* ReallocT(T *t_ptr, size_t num_elements) return t_ptr; } +/** alloca() has to be called in the parent function, so define AllocaM() as a macro */ +#define AllocaM(T, num_elements) ((T*)alloca((num_elements) * sizeof(T))) + #endif /* ALLOC_FUNC_HPP */ |