Re: A micro-optimisation for walkdir() - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: A micro-optimisation for walkdir()
Date
Msg-id 20200904202849.GA17763@alvherre.pgsql
Whole thread Raw
In response to Re: A micro-optimisation for walkdir()  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Responses Re: A micro-optimisation for walkdir()
List pgsql-hackers
On 2020-Sep-04, Juan José Santamaría Flecha wrote:

> On Fri, Sep 4, 2020 at 9:37 PM Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:
> 
> > On 2020-Sep-04, Thomas Munro wrote:

> > >
> > > +/* File types for 'd_type'. */
> > > +enum
> > > +  {
> > > +     DT_UNKNOWN = 0,
> > > +# define DT_UNKNOWN          DT_UNKNOWN
> >
> > Uhm ... what do these #defines do?  They look a bit funny.
> >
> > Would it make sense to give this enum a name, and then use that name in
> > struct dirent's definition, instead of unsigned char?
> 
> They mimic POSIX dirent.h. I would rather stick to that.

Ah ... they do?

If you remove the #define lines, what happens to your patch?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [PATCH] Comments related to " buffer descriptors“ cache line size"
Next
From: Juan José Santamaría Flecha
Date:
Subject: Re: A micro-optimisation for walkdir()