Skip to content

Commit 2e4db24

Browse files
committed
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
1 parent 43a54a3 commit 2e4db24

File tree

24 files changed

+18
-190
lines changed

24 files changed

+18
-190
lines changed

configure

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,6 @@ with_system_tzdata
866866
with_zlib
867867
with_gnu_ld
868868
enable_largefile
869-
enable_float4_byval
870869
enable_float8_byval
871870
'
872871
ac_precious_vars='build_alias
@@ -1525,7 +1524,6 @@ Optional Features:
15251524
--enable-cassert enable assertion checks (for debugging)
15261525
--disable-thread-safety disable thread-safety in client libraries
15271526
--disable-largefile omit support for large files
1528-
--disable-float4-byval disable float4 passed by value
15291527
--disable-float8-byval disable float8 passed by value
15301528

15311529
Optional Packages:
@@ -16747,46 +16745,6 @@ _ACEOF
1674716745

1674816746

1674916747

16750-
# Decide whether float4 is passed by value: user-selectable, enabled by default
16751-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
16752-
$as_echo_n "checking whether to build with float4 passed by value... " >&6; }
16753-
16754-
16755-
# Check whether --enable-float4-byval was given.
16756-
if test "${enable_float4_byval+set}" = set; then :
16757-
enableval=$enable_float4_byval;
16758-
case $enableval in
16759-
yes)
16760-
16761-
$as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
16762-
16763-
float4passbyval=true
16764-
;;
16765-
no)
16766-
float4passbyval=false
16767-
;;
16768-
*)
16769-
as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
16770-
;;
16771-
esac
16772-
16773-
else
16774-
enable_float4_byval=yes
16775-
16776-
$as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
16777-
16778-
float4passbyval=true
16779-
fi
16780-
16781-
16782-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
16783-
$as_echo "$enable_float4_byval" >&6; }
16784-
16785-
cat >>confdefs.h <<_ACEOF
16786-
#define FLOAT4PASSBYVAL $float4passbyval
16787-
_ACEOF
16788-
16789-
1679016748
# Decide whether float8 is passed by value.
1679116749
# Note: this setting also controls int8 and related types such as timestamp.
1679216750
# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.

configure.in

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,16 +1941,6 @@ AC_CHECK_SIZEOF([void *])
19411941
AC_CHECK_SIZEOF([size_t])
19421942
AC_CHECK_SIZEOF([long])
19431943

1944-
# Decide whether float4 is passed by value: user-selectable, enabled by default
1945-
AC_MSG_CHECKING([whether to build with float4 passed by value])
1946-
PGAC_ARG_BOOL(enable, float4-byval, yes, [disable float4 passed by value],
1947-
[AC_DEFINE([USE_FLOAT4_BYVAL], 1,
1948-
[Define to 1 if you want float4 values to be passed by value. (--enable-float4-byval)])
1949-
float4passbyval=true],
1950-
[float4passbyval=false])
1951-
AC_MSG_RESULT([$enable_float4_byval])
1952-
AC_DEFINE_UNQUOTED([FLOAT4PASSBYVAL], [$float4passbyval], [float4 values are passed by value if 'true', by reference if 'false'])
1953-
19541944
# Decide whether float8 is passed by value.
19551945
# Note: this setting also controls int8 and related types such as timestamp.
19561946
# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.

doc/src/sgml/func.sgml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19964,11 +19964,6 @@ SELECT collation for ('foo' COLLATE "de_DE");
1996419964
<entry><type>integer</type></entry>
1996519965
</row>
1996619966

19967-
<row>
19968-
<entry><literal>float4_pass_by_value</literal></entry>
19969-
<entry><type>boolean</type></entry>
19970-
</row>
19971-
1997219967
<row>
1997319968
<entry><literal>float8_pass_by_value</literal></entry>
1997419969
<entry><type>boolean</type></entry>

doc/src/sgml/installation.sgml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,18 +1204,6 @@ build-postgresql:
12041204
</listitem>
12051205
</varlistentry>
12061206

1207-
<varlistentry>
1208-
<term><option>--disable-float4-byval</option></term>
1209-
<listitem>
1210-
<para>
1211-
Disable passing float4 values <quote>by value</quote>, causing them
1212-
to be passed <quote>by reference</quote> instead. This option costs
1213-
performance, but may be needed for compatibility with very old
1214-
user-defined functions written in C.
1215-
</para>
1216-
</listitem>
1217-
</varlistentry>
1218-
12191207
<varlistentry>
12201208
<term><option>--disable-float8-byval</option></term>
12211209
<listitem>

src/backend/access/index/indexam.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,6 @@ index_store_float8_orderby_distances(IndexScanDesc scan, Oid *orderByTypes,
879879
else if (orderByTypes[i] == FLOAT4OID)
880880
{
881881
/* convert distance function's result to ORDER BY type */
882-
#ifndef USE_FLOAT4_BYVAL
883-
/* must free any old value to avoid memory leakage */
884-
if (!scan->xs_orderbynulls[i])
885-
pfree(DatumGetPointer(scan->xs_orderbyvals[i]));
886-
#endif
887882
if (distances && !distances[i].isnull)
888883
{
889884
scan->xs_orderbyvals[i] = Float4GetDatum((float4) distances[i].value);

src/backend/access/transam/xlog.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4516,7 +4516,6 @@ WriteControlFile(void)
45164516
ControlFile->toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE;
45174517
ControlFile->loblksize = LOBLKSIZE;
45184518

4519-
ControlFile->float4ByVal = FLOAT4PASSBYVAL;
45204519
ControlFile->float8ByVal = FLOAT8PASSBYVAL;
45214520

45224521
/* Contents are protected with a CRC */
@@ -4720,22 +4719,6 @@ ReadControlFile(void)
47204719
ControlFile->loblksize, (int) LOBLKSIZE),
47214720
errhint("It looks like you need to recompile or initdb.")));
47224721

4723-
#ifdef USE_FLOAT4_BYVAL
4724-
if (ControlFile->float4ByVal != true)
4725-
ereport(FATAL,
4726-
(errmsg("database files are incompatible with server"),
4727-
errdetail("The database cluster was initialized without USE_FLOAT4_BYVAL"
4728-
" but the server was compiled with USE_FLOAT4_BYVAL."),
4729-
errhint("It looks like you need to recompile or initdb.")));
4730-
#else
4731-
if (ControlFile->float4ByVal != false)
4732-
ereport(FATAL,
4733-
(errmsg("database files are incompatible with server"),
4734-
errdetail("The database cluster was initialized with USE_FLOAT4_BYVAL"
4735-
" but the server was compiled without USE_FLOAT4_BYVAL."),
4736-
errhint("It looks like you need to recompile or initdb.")));
4737-
#endif
4738-
47394722
#ifdef USE_FLOAT8_BYVAL
47404723
if (ControlFile->float8ByVal != true)
47414724
ereport(FATAL,

src/backend/bootstrap/bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static const struct typinfo TypInfo[] = {
111111
F_INT2IN, F_INT2OUT},
112112
{"int4", INT4OID, 0, 4, true, 'i', 'p', InvalidOid,
113113
F_INT4IN, F_INT4OUT},
114-
{"float4", FLOAT4OID, 0, 4, FLOAT4PASSBYVAL, 'i', 'p', InvalidOid,
114+
{"float4", FLOAT4OID, 0, 4, true, 'i', 'p', InvalidOid,
115115
F_FLOAT4IN, F_FLOAT4OUT},
116116
{"name", NAMEOID, CHAROID, NAMEDATALEN, false, 'c', 'p', C_COLLATION_OID,
117117
F_NAMEIN, F_NAMEOUT},

src/backend/catalog/genbki.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ sub morph_row_for_schemapg
890890
}
891891

892892
# Expand booleans from 'f'/'t' to 'false'/'true'.
893-
# Some values might be other macros (eg FLOAT4PASSBYVAL),
893+
# Some values might be other macros (eg FLOAT8PASSBYVAL),
894894
# don't change.
895895
elsif ($atttype eq 'bool')
896896
{

src/backend/commands/analyze.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats)
14961496
/* XXX knows more than it should about type float4: */
14971497
arry = construct_array(numdatums, nnum,
14981498
FLOAT4OID,
1499-
sizeof(float4), FLOAT4PASSBYVAL, 'i');
1499+
sizeof(float4), true, 'i');
15001500
values[i++] = PointerGetDatum(arry); /* stanumbersN */
15011501
}
15021502
else

src/backend/utils/fmgr/dfmgr.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,6 @@ incompatible_module_error(const char *libname,
365365
magic_data.namedatalen,
366366
module_magic_data->namedatalen);
367367
}
368-
if (module_magic_data->float4byval != magic_data.float4byval)
369-
{
370-
if (details.len)
371-
appendStringInfoChar(&details, '\n');
372-
appendStringInfo(&details,
373-
_("Server has FLOAT4PASSBYVAL = %s, library has %s."),
374-
magic_data.float4byval ? "true" : "false",
375-
module_magic_data->float4byval ? "true" : "false");
376-
}
377368
if (module_magic_data->float8byval != magic_data.float8byval)
378369
{
379370
if (details.len)

0 commit comments

Comments
 (0)