diff options
author | Andres Freund <andres@anarazel.de> | 2017-09-29 15:52:55 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2017-09-29 17:24:39 -0700 |
commit | 510b8cbff15fcece246f66f2273ccf830a6c7e98 (patch) | |
tree | 75dc05371931da2dfb72ba33084689658daa537c /contrib/btree_gist/btree_uuid.c | |
parent | 0008a106d4f84206a96fc1fb09a1e6b09f1627ec (diff) | |
download | postgresql-510b8cbff15fcece246f66f2273ccf830a6c7e98.tar.gz postgresql-510b8cbff15fcece246f66f2273ccf830a6c7e98.zip |
Extend & revamp pg_bswap.h infrastructure.
Upcoming patches are going to address performance issues that involve
slow system provided ntohs/htons etc. To address that expand
pg_bswap.h to provide pg_ntoh{16,32,64}, pg_hton{16,32,64} and
optimize their respective implementations by using compiler intrinsics
for gcc compatible compilers and msvc. Fall back to manual
implementations using shifts etc otherwise.
Additionally remove multiple evaluation hazards from the existing
BSWAP32/64 macros, by replacing them with inline functions when
necessary. In the course of that the naming scheme is changed to
pg_bswap16/32/64.
Author: Andres Freund
Discussion: https://postgr.es/m/20170927172019.gheidqy6xvlxb325@alap3.anarazel.de
Diffstat (limited to 'contrib/btree_gist/btree_uuid.c')
-rw-r--r-- | contrib/btree_gist/btree_uuid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c index ecf357d662c..9ff421ea557 100644 --- a/contrib/btree_gist/btree_uuid.c +++ b/contrib/btree_gist/btree_uuid.c @@ -182,8 +182,8 @@ uuid_2_double(const pg_uuid_t *u) * machine, byte-swap each half so we can use native uint64 arithmetic. */ #ifndef WORDS_BIGENDIAN - uu[0] = BSWAP64(uu[0]); - uu[1] = BSWAP64(uu[1]); + uu[0] = pg_bswap64(uu[0]); + uu[1] = pg_bswap64(uu[1]); #endif /* |