From 2f0efe9f592255d0d83c0929423cc397bb1ebfa4 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 24 Jul 2014 08:45:16 -0700 Subject: 32853: redefine VARARR() to use heap rather than stack allocation enable old behavior via "configure --with-stack-allocation" --- Src/zsh_system.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Src/zsh_system.h') diff --git a/Src/zsh_system.h b/Src/zsh_system.h index 601de69f6..811340d42 100644 --- a/Src/zsh_system.h +++ b/Src/zsh_system.h @@ -286,11 +286,15 @@ struct timezone { # include #endif +#ifdef USE_STACK_ALLOCATION #ifdef HAVE_VARIABLE_LENGTH_ARRAYS # define VARARR(X,Y,Z) X (Y)[Z] #else # define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z)) #endif +#else +# define VARARR(X,Y,Z) X *(Y) = (X *) zhalloc(sizeof(X) * (Z)) +#endif /* we should handle unlimited sizes from pathconf(_PC_PATH_MAX) */ /* but this is too much trouble */ -- cgit 1.4.1