From df6a127b4dbb96dd970d255635ccfeae17a38186 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 10 Aug 2016 11:24:19 +0530 Subject: libglusterfs: move alloca0 definition to common-utils ...and remove their definitons from EC and AFR. Also `s/alloca+memset0/alloca0` wherever it is used. Change-Id: I3b71e596d12a7d8900f5d761af6b98305c8874d5 BUG: 1366226 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/15147 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri CentOS-regression: Gluster Build System --- libglusterfs/src/common-utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs/src/common-utils.h') diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index aacf2c5a32c..fa5d28d92b3 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -44,6 +44,8 @@ void trap (void); #define STRINGIFY(val) #val #define TOSTRING(val) STRINGIFY(val) +#define alloca0(size) ({void *__ptr; __ptr = alloca(size); memset(__ptr, 0, size); __ptr; }) + #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) #define roof(a,b) ((((a)+(b)-1)/((b)?(b):1))*(b)) -- cgit