pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Constifying numeric.c's local vars
Date: Mon, 11 Sep 2017 08:10:14 -0400
Message-ID: <11630.1505131814@sss.pgh.pa.us> (raw)
In-Reply-To: <20170910232154.asgml44ji2b7lv3d@alap3.anarazel.de>
References: <20170910232154.asgml44ji2b7lv3d@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



view thread (6+ messages)  latest in thread

Message-ID: <11630.1505131814@sss.pgh.pa.us>
Permalink:  ../11630.1505131814@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11630.1505131814@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: Constifying numeric.c's local vars
  In-Reply-To: <11630.1505131814@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox