aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2006-02-16 23:23:50 +0000
committerPeter Eisentraut <peter_e@gmx.net>2006-02-16 23:23:50 +0000
commit15a3c33164692c06601b330b9c86a05a0c4e188e (patch)
treeccc454407176d24d6895f8e328342570baac8be2 /src
parent422998d275737fb43effa24eb26545cce73b056c (diff)
downloadpostgresql-15a3c33164692c06601b330b9c86a05a0c4e188e.tar.gz
postgresql-15a3c33164692c06601b330b9c86a05a0c4e188e.zip
Change MemSet to use long instead of int32, for better performance on
64-bit platforms. by ITAGAKI Takahiro
Diffstat (limited to 'src')
-rw-r--r--src/include/c.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 8c3881bf9e0..adade7f6456 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/c.h,v 1.195 2006/02/03 13:53:15 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.196 2006/02/16 23:23:50 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -603,8 +603,8 @@ typedef NameData *Name;
} while (0)
-/* Get a bit mask of the bits set in non-int32 aligned addresses */
-#define INT_ALIGN_MASK (sizeof(int32) - 1)
+/* Get a bit mask of the bits set in non-long aligned addresses */
+#define LONG_ALIGN_MASK (sizeof(long) - 1)
/*
* MemSet
@@ -624,8 +624,8 @@ typedef NameData *Name;
int _val = (val); \
Size _len = (len); \
\
- if ((((long) _vstart) & INT_ALIGN_MASK) == 0 && \
- (_len & INT_ALIGN_MASK) == 0 && \
+ if ((((long) _vstart) & LONG_ALIGN_MASK) == 0 && \
+ (_len & LONG_ALIGN_MASK) == 0 && \
_val == 0 && \
_len <= MEMSET_LOOP_LIMIT && \
/* \
@@ -634,8 +634,8 @@ typedef NameData *Name;
*/ \
MEMSET_LOOP_LIMIT != 0) \
{ \
- int32 *_start = (int32 *) _vstart; \
- int32 *_stop = (int32 *) ((char *) _start + _len); \
+ long *_start = (long *) _vstart; \
+ long *_stop = (long *) ((char *) _start + _len); \
while (_start < _stop) \
*_start++ = 0; \
} \
@@ -652,16 +652,16 @@ typedef NameData *Name;
#define MemSetAligned(start, val, len) \
do \
{ \
- int32 *_start = (int32 *) (start); \
+ long *_start = (long *) (start); \
int _val = (val); \
Size _len = (len); \
\
- if ((_len & INT_ALIGN_MASK) == 0 && \
+ if ((_len & LONG_ALIGN_MASK) == 0 && \
_val == 0 && \
_len <= MEMSET_LOOP_LIMIT && \
MEMSET_LOOP_LIMIT != 0) \
{ \
- int32 *_stop = (int32 *) ((char *) _start + _len); \
+ long *_stop = (long *) ((char *) _start + _len); \
while (_start < _stop) \
*_start++ = 0; \
} \
@@ -679,7 +679,7 @@ typedef NameData *Name;
* this approach.
*/
#define MemSetTest(val, len) \
- ( ((len) & INT_ALIGN_MASK) == 0 && \
+ ( ((len) & LONG_ALIGN_MASK) == 0 && \
(len) <= MEMSET_LOOP_LIMIT && \
MEMSET_LOOP_LIMIT != 0 && \
(val) == 0 )
@@ -687,8 +687,8 @@ typedef NameData *Name;
#define MemSetLoop(start, val, len) \
do \
{ \
- int32 * _start = (int32 *) (start); \
- int32 * _stop = (int32 *) ((char *) _start + (Size) (len)); \
+ long * _start = (long *) (start); \
+ long * _stop = (long *) ((char *) _start + (Size) (len)); \
\
while (_start < _stop) \
*_start++ = 0; \