Remove configure --disable-float4-byval

This build option was only useful to maintain compatibility for
version-0 functions, but those are no longer supported, so this option
can be removed.

float4 is now always pass-by-value; the pass-by-reference code path is
completely removed.

Discussion: https://www.postgresql.org/message-id/flat/f3e1e576-2749-bbd7-2d57-3f9dcf75255a@2ndquadrant.com
This commit is contained in:
Peter Eisentraut
2019-11-21 18:00:07 +01:00
parent 43a54a3bcc
commit 2e4db241bf
24 changed files with 18 additions and 190 deletions

View File

@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201911211
#define CATALOG_VERSION_NO 201911212
#endif

View File

@ -22,7 +22,7 @@
/* Version identifier for this pg_control format */
#define PG_CONTROL_VERSION 1201
#define PG_CONTROL_VERSION 1300
/* Nonce key length, see below */
#define MOCK_AUTH_NONCE_LEN 32
@ -214,8 +214,6 @@ typedef struct ControlFileData
uint32 toast_max_chunk_size; /* chunk size in TOAST tables */
uint32 loblksize; /* chunk size in pg_largeobject */
/* flags indicating pass-by-value status of various types */
bool float4ByVal; /* float4 pass-by-value? */
bool float8ByVal; /* float8, int8, etc pass-by-value? */
/* Are data pages protected by checksums? Zero if no checksum version */

View File

@ -10660,9 +10660,9 @@
descr => 'pg_controldata init state information as a function',
proname => 'pg_control_init', provolatile => 'v', prorettype => 'record',
proargtypes => '',
proallargtypes => '{int4,int4,int4,int4,int4,int4,int4,int4,int4,bool,bool,int4}',
proargmodes => '{o,o,o,o,o,o,o,o,o,o,o,o}',
proargnames => '{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,float4_pass_by_value,float8_pass_by_value,data_page_checksum_version}',
proallargtypes => '{int4,int4,int4,int4,int4,int4,int4,int4,int4,bool,int4}',
proargmodes => '{o,o,o,o,o,o,o,o,o,o,o}',
proargnames => '{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,float8_pass_by_value,data_page_checksum_version}',
prosrc => 'pg_control_init' },
# collation management functions

View File

@ -215,7 +215,7 @@
{ oid => '700', array_type_oid => '1021',
descr => 'single-precision floating point number, 4-byte storage',
typname => 'float4', typlen => '4', typbyval => 'FLOAT4PASSBYVAL',
typname => 'float4', typlen => '4', typbyval => 't',
typcategory => 'N', typinput => 'float4in', typoutput => 'float4out',
typreceive => 'float4recv', typsend => 'float4send', typalign => 'i' },
{ oid => '701', array_type_oid => '1022',

View File

@ -446,7 +446,6 @@ typedef struct
int funcmaxargs; /* FUNC_MAX_ARGS */
int indexmaxkeys; /* INDEX_MAX_KEYS */
int namedatalen; /* NAMEDATALEN */
int float4byval; /* FLOAT4PASSBYVAL */
int float8byval; /* FLOAT8PASSBYVAL */
} Pg_magic_struct;
@ -458,7 +457,6 @@ typedef struct
FUNC_MAX_ARGS, \
INDEX_MAX_KEYS, \
NAMEDATALEN, \
FLOAT4PASSBYVAL, \
FLOAT8PASSBYVAL \
}

View File

@ -70,9 +70,6 @@
MSVC and with C++ compilers. */
#undef FLEXIBLE_ARRAY_MEMBER
/* float4 values are passed by value if 'true', by reference if 'false' */
#undef FLOAT4PASSBYVAL
/* float8, int8, and related values are passed by value if 'true', by
reference if 'false' */
#undef FLOAT8PASSBYVAL
@ -901,10 +898,6 @@
/* Define to use /dev/urandom for random number generation */
#undef USE_DEV_URANDOM
/* Define to 1 if you want float4 values to be passed by value.
(--enable-float4-byval) */
#undef USE_FLOAT4_BYVAL
/* Define to 1 if you want float8, int8, etc values to be passed by value.
(--enable-float8-byval) */
#undef USE_FLOAT8_BYVAL

View File

@ -659,11 +659,7 @@ extern Datum Int64GetDatum(int64 X);
/*
* DatumGetFloat4
* Returns 4-byte floating point value of a datum.
*
* Note: this macro hides whether float4 is pass by value or by reference.
*/
#ifdef USE_FLOAT4_BYVAL
static inline float4
DatumGetFloat4(Datum X)
{
@ -676,18 +672,11 @@ DatumGetFloat4(Datum X)
myunion.value = DatumGetInt32(X);
return myunion.retval;
}
#else
#define DatumGetFloat4(X) (* ((float4 *) DatumGetPointer(X)))
#endif
/*
* Float4GetDatum
* Returns datum representation for a 4-byte floating point number.
*
* Note: if float4 is pass by reference, this function returns a reference
* to palloc'd space.
*/
#ifdef USE_FLOAT4_BYVAL
static inline Datum
Float4GetDatum(float4 X)
{
@ -700,9 +689,6 @@ Float4GetDatum(float4 X)
myunion.value = X;
return Int32GetDatum(myunion.retval);
}
#else
extern Datum Float4GetDatum(float4 X);
#endif
/*
* DatumGetFloat8
@ -757,10 +743,9 @@ extern Datum Float8GetDatum(float8 X);
/*
* Int64GetDatumFast
* Float8GetDatumFast
* Float4GetDatumFast
*
* These macros are intended to allow writing code that does not depend on
* whether int64, float8, float4 are pass-by-reference types, while not
* whether int64 and float8 are pass-by-reference types, while not
* sacrificing performance when they are. The argument must be a variable
* that will exist and have the same value for as long as the Datum is needed.
* In the pass-by-ref case, the address of the variable is taken to use as
@ -776,10 +761,4 @@ extern Datum Float8GetDatum(float8 X);
#define Float8GetDatumFast(X) PointerGetDatum(&(X))
#endif
#ifdef USE_FLOAT4_BYVAL
#define Float4GetDatumFast(X) Float4GetDatum(X)
#else
#define Float4GetDatumFast(X) PointerGetDatum(&(X))
#endif
#endif /* POSTGRES_H */