Re: [HACKERS] Constifying numeric.c's local vars - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Constifying numeric.c's local vars
Date
Msg-id 11630.1505131814@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Constifying numeric.c's local vars  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] Constifying numeric.c's local vars
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> One large user of unnecessary non-constant static variables is
> numeric.c.  More out of curiosity - numeric is slow enough in itself to
> make inlining not a huge win - I converted it to use consts.

LGTM.

> It's a bit ugly that some consts have to be casted away in the constant
> definitions, but aside from just inlining the values, I don't quite see
> a better solution?

No, I don't either.  I'm not sure that writing the constant inline would
produce the desired results - the compiler might well decide that it had
to be in read-write storage.
        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Partition-wise join for join between (declaratively)partitioned tables
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] Re: proposal - using names as primary names of plpgsqlfunction parameters instead $ based names