Thread

Commits

  1. Tighten configure's test for __builtin_constant_p().

  2. Rethink MemoryContext creation to improve performance.

  1. Sun Studio 12 vs. __builtin_constant_p()

    Tom Lane <tgl@sss.pgh.pa.us> — 2017-12-14T15:07:46Z

    Well, that's annoying: buildfarm member castoroides just fell over
    with symptoms indicating that its compiler thinks that
    __builtin_constant_p("string literal") is false, thus breaking the
    check I installed in commit 9fa6f00b1 that AllocSetContextCreate's
    name argument is a literal.
    
    https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=castoroides&dt=2017-12-14%2013%3A03%3A05
    
    I think removing that check would be entirely impractical, and
    anyway it's sufficient if it works on "most people's" compilers.
    Fortunately, buildfarm results so far suggest that most compilers
    do accept this usage of __builtin_constant_p, if they know the
    function at all.
    
    What I propose to do is adjust the configure check for
    __builtin_constant_p so that it explicitly checks for
    __builtin_constant_p("string literal") being true, in addition
    to what it tests now.  That will result in slightly worse
    code optimization around ereport/elog calls on compilers that
    don't have this behavior, but that seems fine to me.
    
    			regards, tom lane