mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-13 01:47:05 +08:00
Remove all the special-case code for INT64_IS_BUSTED, per decision that
we're not going to support that anymore. I did keep the 64-bit-CRC-with-32-bit-arithmetic code, since it has a performance excuse to live. It's a bit moot since that's all ifdef'd out, of course.
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/c.h,v 1.238 2010/01/02 16:58:00 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/c.h,v 1.239 2010/01/07 04:53:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -270,6 +270,7 @@ typedef long int int64;
|
||||
#ifndef HAVE_UINT64
|
||||
typedef unsigned long int uint64;
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_LONG_LONG_INT_64)
|
||||
/* We have working support for "long long int", use that */
|
||||
|
||||
@ -279,20 +280,11 @@ typedef long long int int64;
|
||||
#ifndef HAVE_UINT64
|
||||
typedef unsigned long long int uint64;
|
||||
#endif
|
||||
#else /* not HAVE_LONG_INT_64 and not
|
||||
* HAVE_LONG_LONG_INT_64 */
|
||||
|
||||
/* Won't actually work, but fall back to long int so that code compiles */
|
||||
#ifndef HAVE_INT64
|
||||
typedef long int int64;
|
||||
#else
|
||||
/* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */
|
||||
#error must have a working 64-bit integer datatype
|
||||
#endif
|
||||
#ifndef HAVE_UINT64
|
||||
typedef unsigned long int uint64;
|
||||
#endif
|
||||
|
||||
#define INT64_IS_BUSTED
|
||||
#endif /* not HAVE_LONG_INT_64 and not
|
||||
* HAVE_LONG_LONG_INT_64 */
|
||||
|
||||
/* Decide if we need to decorate 64-bit constants */
|
||||
#ifdef HAVE_LL_CONSTANTS
|
||||
@ -305,7 +297,7 @@ typedef unsigned long int uint64;
|
||||
|
||||
|
||||
/* Select timestamp representation (float8 or int64) */
|
||||
#if defined(USE_INTEGER_DATETIMES) && !defined(INT64_IS_BUSTED)
|
||||
#ifdef USE_INTEGER_DATETIMES
|
||||
#define HAVE_INT64_TIMESTAMP
|
||||
#endif
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.43 2010/01/02 16:58:03 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.44 2010/01/07 04:53:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -19,16 +19,9 @@
|
||||
#include "fmgr.h"
|
||||
|
||||
|
||||
/*
|
||||
* On a machine with no 64-bit-int C datatype, sizeof(int64) will not be 8,
|
||||
* but we need this struct type to line up with the way that a sequence
|
||||
* table is defined --- and pg_type will say that int8 is 8 bytes anyway.
|
||||
* So, we need padding. Ugly but necessary.
|
||||
*/
|
||||
typedef struct FormData_pg_sequence
|
||||
{
|
||||
NameData sequence_name;
|
||||
#ifndef INT64_IS_BUSTED
|
||||
int64 last_value;
|
||||
int64 start_value;
|
||||
int64 increment_by;
|
||||
@ -36,22 +29,6 @@ typedef struct FormData_pg_sequence
|
||||
int64 min_value;
|
||||
int64 cache_value;
|
||||
int64 log_cnt;
|
||||
#else
|
||||
int32 last_value;
|
||||
int32 pad1;
|
||||
int32 start_value;
|
||||
int32 pad2;
|
||||
int32 increment_by;
|
||||
int32 pad3;
|
||||
int32 max_value;
|
||||
int32 pad4;
|
||||
int32 min_value;
|
||||
int32 pad5;
|
||||
int32 cache_value;
|
||||
int32 pad6;
|
||||
int32 log_cnt;
|
||||
int32 pad7;
|
||||
#endif
|
||||
bool is_cycled;
|
||||
bool is_called;
|
||||
} FormData_pg_sequence;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* for developers. If you edit any of these, be sure to do a *full*
|
||||
* rebuild (and an initdb if noted).
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.39 2009/06/11 14:49:08 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.40 2010/01/07 04:53:35 tgl Exp $
|
||||
*------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@ -45,12 +45,7 @@
|
||||
/*
|
||||
* Set the upper and lower bounds of sequence values.
|
||||
*/
|
||||
#ifndef INT64_IS_BUSTED
|
||||
#define SEQ_MAXVALUE INT64CONST(0x7FFFFFFFFFFFFFFF)
|
||||
#else /* INT64_IS_BUSTED */
|
||||
#define SEQ_MAXVALUE ((int64) 0x7FFFFFFF)
|
||||
#endif /* INT64_IS_BUSTED */
|
||||
|
||||
#define SEQ_MINVALUE (-SEQ_MAXVALUE)
|
||||
|
||||
/*
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/pg_crc.h,v 1.22 2010/01/02 16:58:10 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/pg_crc.h,v 1.23 2010/01/07 04:53:35 tgl Exp $
|
||||
*/
|
||||
#ifndef PG_CRC_H
|
||||
#define PG_CRC_H
|
||||
@ -60,15 +60,14 @@ extern CRCDLLIMPORT const uint32 pg_crc32_table[];
|
||||
#ifdef PROVIDE_64BIT_CRC
|
||||
|
||||
/*
|
||||
* If we have a 64-bit integer type, then a 64-bit CRC looks just like the
|
||||
* usual sort of implementation. If we have no working 64-bit type, then
|
||||
* fake it with two 32-bit registers. (Note: experience has shown that the
|
||||
* two-32-bit-registers code is as fast as, or even much faster than, the
|
||||
* 64-bit code on all but true 64-bit machines. INT64_IS_BUSTED is therefore
|
||||
* probably the wrong control symbol to use to select the implementation.)
|
||||
* If we use a 64-bit integer type, then a 64-bit CRC looks just like the
|
||||
* usual sort of implementation. However, we can also fake it with two
|
||||
* 32-bit registers. Experience has shown that the two-32-bit-registers code
|
||||
* is as fast as, or even much faster than, the 64-bit code on all but true
|
||||
* 64-bit machines. We use SIZEOF_VOID_P to check the native word width.
|
||||
*/
|
||||
|
||||
#ifdef INT64_IS_BUSTED
|
||||
#if SIZEOF_VOID_P < 8
|
||||
|
||||
/*
|
||||
* crc0 represents the LSBs of the 64-bit value, crc1 the MSBs. Note that
|
||||
@ -114,7 +113,8 @@ do { \
|
||||
/* Constant table for CRC calculation */
|
||||
extern CRCDLLIMPORT const uint32 pg_crc64_table0[];
|
||||
extern CRCDLLIMPORT const uint32 pg_crc64_table1[];
|
||||
#else /* int64 works */
|
||||
|
||||
#else /* use int64 implementation */
|
||||
|
||||
typedef struct pg_crc64
|
||||
{
|
||||
@ -147,7 +147,7 @@ do { \
|
||||
|
||||
/* Constant table for CRC calculation */
|
||||
extern CRCDLLIMPORT const uint64 pg_crc64_table[];
|
||||
#endif /* INT64_IS_BUSTED */
|
||||
#endif /* SIZEOF_VOID_P < 8 */
|
||||
#endif /* PROVIDE_64BIT_CRC */
|
||||
|
||||
#endif /* PG_CRC_H */
|
||||
|
||||
Reference in New Issue
Block a user