mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Remove the use of htonl() in the previous check-in due to linkage issues.
Add the get2byteAligned() macro and use it for access to the cell offsets on btree pages for about a 1% performance gain. FossilOrigin-Name: 79ff36b7170c9e7e7a9935c8b9d1665867771087
This commit is contained in:
@@ -1082,10 +1082,6 @@ u32 sqlite3Get4byte(const u8 *p){
|
||||
u32 x;
|
||||
memcpy(&x,p,4);
|
||||
return x;
|
||||
#elif defined(_MSC_VER)
|
||||
u32 x;
|
||||
memcpy(&x,p,4);
|
||||
return htonl(x);
|
||||
#elif SQLITE_BYTEORDER==1234 && defined(__GNUC__)
|
||||
u32 x;
|
||||
memcpy(&x,p,4);
|
||||
@@ -1098,9 +1094,6 @@ u32 sqlite3Get4byte(const u8 *p){
|
||||
void sqlite3Put4byte(unsigned char *p, u32 v){
|
||||
#if SQLITE_BYTEORDER==4321
|
||||
memcpy(p,&v,4);
|
||||
#elif defined(_MSC_VER)
|
||||
u32 x = htonl(v);
|
||||
memcpy(&x,p,4);
|
||||
#elif SQLITE_BYTEORDER==1234 && defined(__GNUC__)
|
||||
u32 x = __builtin_bswap32(v);
|
||||
memcpy(p,&x,4);
|
||||
|
||||
Reference in New Issue
Block a user