mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
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
This commit is contained in:
@ -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
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user