Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
15a3c331
Commit
15a3c331
authored
19 years ago
by
Peter Eisentraut
Browse files
Options
Downloads
Patches
Plain Diff
Change MemSet to use long instead of int32, for better performance on
64-bit platforms. by ITAGAKI Takahiro
parent
422998d2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/include/c.h
+13
-13
13 additions, 13 deletions
src/include/c.h
with
13 additions
and
13 deletions
src/include/c.h
+
13
−
13
View file @
15a3c331
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/include/c.h,v 1.19
5
2006/02/
03 1
3:
5
3:
15 momjian
Exp $
* $PostgreSQL: pgsql/src/include/c.h,v 1.19
6
2006/02/
16 2
3:
2
3:
50 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -603,8 +603,8 @@ typedef NameData *Name;
...
@@ -603,8 +603,8 @@ typedef NameData *Name;
} while (0)
} while (0)
/* Get a bit mask of the bits set in non-
int32
aligned addresses */
/* Get a bit mask of the bits set in non-
long
aligned addresses */
#define
INT
_ALIGN_MASK (sizeof(
int32
) - 1)
#define
LONG
_ALIGN_MASK (sizeof(
long
) - 1)
/*
/*
* MemSet
* MemSet
...
@@ -624,8 +624,8 @@ typedef NameData *Name;
...
@@ -624,8 +624,8 @@ typedef NameData *Name;
int _val = (val); \
int _val = (val); \
Size _len = (len); \
Size _len = (len); \
\
\
if ((((long) _vstart) &
INT
_ALIGN_MASK) == 0 && \
if ((((long) _vstart) &
LONG
_ALIGN_MASK) == 0 && \
(_len &
INT
_ALIGN_MASK) == 0 && \
(_len &
LONG
_ALIGN_MASK) == 0 && \
_val == 0 && \
_val == 0 && \
_len <= MEMSET_LOOP_LIMIT && \
_len <= MEMSET_LOOP_LIMIT && \
/* \
/* \
...
@@ -634,8 +634,8 @@ typedef NameData *Name;
...
@@ -634,8 +634,8 @@ typedef NameData *Name;
*/
\
*/
\
MEMSET_LOOP_LIMIT != 0) \
MEMSET_LOOP_LIMIT != 0) \
{ \
{ \
int32
*_start = (
int32
*) _vstart; \
long
*_start = (
long
*) _vstart; \
int32
*_stop = (
int32
*) ((char *) _start + _len); \
long
*_stop = (
long
*) ((char *) _start + _len); \
while (_start < _stop) \
while (_start < _stop) \
*_start++ = 0; \
*_start++ = 0; \
} \
} \
...
@@ -652,16 +652,16 @@ typedef NameData *Name;
...
@@ -652,16 +652,16 @@ typedef NameData *Name;
#define MemSetAligned(start, val, len) \
#define MemSetAligned(start, val, len) \
do \
do \
{ \
{ \
int32
*_start = (
int32
*) (start); \
long
*_start = (
long
*) (start); \
int _val = (val); \
int _val = (val); \
Size _len = (len); \
Size _len = (len); \
\
\
if ((_len &
INT
_ALIGN_MASK) == 0 && \
if ((_len &
LONG
_ALIGN_MASK) == 0 && \
_val == 0 && \
_val == 0 && \
_len <= MEMSET_LOOP_LIMIT && \
_len <= MEMSET_LOOP_LIMIT && \
MEMSET_LOOP_LIMIT != 0) \
MEMSET_LOOP_LIMIT != 0) \
{ \
{ \
int32
*_stop = (
int32
*) ((char *) _start + _len); \
long
*_stop = (
long
*) ((char *) _start + _len); \
while (_start < _stop) \
while (_start < _stop) \
*_start++ = 0; \
*_start++ = 0; \
} \
} \
...
@@ -679,7 +679,7 @@ typedef NameData *Name;
...
@@ -679,7 +679,7 @@ typedef NameData *Name;
* this approach.
* this approach.
*/
*/
#define MemSetTest(val, len) \
#define MemSetTest(val, len) \
( ((len) &
INT
_ALIGN_MASK) == 0 && \
( ((len) &
LONG
_ALIGN_MASK) == 0 && \
(len) <= MEMSET_LOOP_LIMIT && \
(len) <= MEMSET_LOOP_LIMIT && \
MEMSET_LOOP_LIMIT != 0 && \
MEMSET_LOOP_LIMIT != 0 && \
(val) == 0 )
(val) == 0 )
...
@@ -687,8 +687,8 @@ typedef NameData *Name;
...
@@ -687,8 +687,8 @@ typedef NameData *Name;
#define MemSetLoop(start, val, len) \
#define MemSetLoop(start, val, len) \
do \
do \
{ \
{ \
int32
* _start = (
int32
*) (start); \
long
* _start = (
long
*) (start); \
int32
* _stop = (
int32
*) ((char *) _start + (Size) (len)); \
long
* _stop = (
long
*) ((char *) _start + (Size) (len)); \
\
\
while (_start < _stop) \
while (_start < _stop) \
*_start++ = 0; \
*_start++ = 0; \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment