Skip to content

Commit e166409

Browse files
committed
Change to MemSet for Alpha.
1 parent 182c205 commit e166409

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/include/c.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: c.h,v 1.31 1998/02/11 21:17:44 momjian Exp $
10+
* $Id: c.h,v 1.32 1998/02/11 21:38:08 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -705,11 +705,16 @@ typedef struct Exception
705705
#define StrNCpy(dst,src,len) \
706706
(strncpy((dst),(src),(len)),(len > 0) ? *((dst)+(len)-1)='\0' : (dummyret)NULL,(void)(dst))
707707

708+
/* Get a bit mask of the bits set in non-int32 aligned addresses */
709+
#define INT_ALIGN_MASK (sizeof(int32) - 1)
710+
708711
/* This function gets call too often, so we inline it if we can */
709712
#define MemSet(start, val, len) do \
710713
{ /* are we aligned for int32? */ \
711-
if ((start) == INTALIGN(start) && \
712-
(len) % sizeof(int32) == 0 && \
714+
/* We have to cast the pointer to int \
715+
so we can do the AND */ \
716+
if (((long)(start) & INT_ALIGN_MASK) == 0 && \
717+
((len) & INT_ALIGN_MASK) == 0 && \
713718
(val) == 0 && \
714719
/* \
715720
* We got this number by testing this \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy