]> granicus.if.org Git - postgresql/commitdiff
Change to MemSet for Alpha.
authorBruce Momjian <bruce@momjian.us>
Wed, 11 Feb 1998 21:38:08 +0000 (21:38 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 11 Feb 1998 21:38:08 +0000 (21:38 +0000)
src/include/c.h

index 1b928b3c6a5848da3b7da601fcb673c424a24172..c97d5e3b1bdaa6b0d74621343570ad6a7ecfe8f8 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: c.h,v 1.31 1998/02/11 21:17:44 momjian Exp $
+ * $Id: c.h,v 1.32 1998/02/11 21:38:08 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -705,11 +705,16 @@ typedef struct Exception
 #define StrNCpy(dst,src,len)   \
        (strncpy((dst),(src),(len)),(len > 0) ? *((dst)+(len)-1)='\0' : (dummyret)NULL,(void)(dst))
 
+/* Get a bit mask of the bits set in non-int32 aligned addresses */
+#define INT_ALIGN_MASK (sizeof(int32) - 1)
+
 /* This function gets call too often, so we inline it if we can */
 #define MemSet(start, val, len) do \
                                                                {       /* are we aligned for int32? */ \
-                                                                       if ((start) == INTALIGN(start) && \
-                                                                               (len) % sizeof(int32) == 0 && \
+                                                                       /* We have to cast the pointer to int \
+                                                                          so we can do the AND */ \
+                                                                       if (((long)(start) & INT_ALIGN_MASK) == 0 && \
+                                                                               ((len) & INT_ALIGN_MASK) == 0 && \
                                                                                (val) == 0 && \
                                                                        /* \
                                                                         * We got this number by testing this \