Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Date
Msg-id 20191001155720.GD11619@momjian.us
Whole thread Raw
In response to Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Responses Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Oct  1, 2019 at 08:40:26AM -0400, Andrew Dunstan wrote:
> 
> On 10/1/19 6:12 AM, Amit Kapila wrote:
> > On Tue, Oct 1, 2019 at 1:25 PM Smith, Peter <peters@fast.au.fujitsu.com> wrote:
> >> Dear Hackers,
> >>
> >> I have identified some OSS code which maybe can make use of C99 designated initialisers for nulls/values arrays.
> >>
> >> ~
> >>
> >> Background:
> >> There are lots of tuple operations where arrays of values and flags are being passed.
> >> Typically these arrays are being previously initialised 0/false by memset.
> >> By modifying code to use C99 designated initialiser syntax [1], most of these memsets can become redundant.
> >> Actually, this mechanism is already being used in some of the existing OSS code. This patch/proposal just
propagatesthe same idea to all other similar places I could find.
 
> >>
> >> ~
> >>
> >> Result:
> >> Less code. Removes ~200 unnecessary memsets.
> >> More consistent initialisation.
> >>
> > +1.  This seems like an improvement.  I can review and take this
> > forward unless there are objections from others.
> >
> >
> 
> +1.

I like it!

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Value of Transparent Data Encryption (TDE)
Next
From: "REIX, Tony"
Date:
Subject: RE: Shared Memory: How to use SYSV rather than MMAP ?