77 *
88 * Copyright (c) 1994, Regents of the University of California
99 *
10- * $Id: c.h,v 1.20 1997/09/1814:20:40 momjian Exp $
10+ * $Id: c.h,v 1.21 1997/09/1817:06:21 momjian Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -698,10 +698,18 @@ typedef struct Exception
698698/* This function gets call too often, so we inline it if we can */
699699#define MemSet (start ,val ,len )do \
700700{/* are we aligned for int32? */ \
701- if (((start) & INT_ALIGN_MASK) == 0 && \
701+ /* We have to cast the pointer to int \
702+ so we can do the AND */ \
703+ if (((int )(start )& INT_ALIGN_MASK )== 0 && \
702704((len )& INT_ALIGN_MASK )== 0 && \
703705(val )== 0 && \
704- (len) <= 256) \
706+ /* \
707+ * We got this number by testing this \
708+ * against the stock memset() on \
709+ * bsd/os 3.0. Larger values were \
710+ * slower. \
711+ */ \
712+ (len ) <=64 ) \
705713{ \
706714int32 * i = (int32 * )(start ); \
707715int32 * stop = (int32 * )((char * )(start )+ (len )); \
@@ -711,7 +719,7 @@ typedef struct Exception
711719} \
712720else \
713721memset ((start ), (val ), (len )); \
714- }
722+ }while ( 0 )
715723
716724/* ----------------------------------------------------------------
717725 *Section 9: externs