Re: PATCH: two slab-like memory allocators - Mailing list pgsql-hackers

From Andres Freund
Subject Re: PATCH: two slab-like memory allocators
Date
Msg-id 20161127204740.dr3swudwsbafjuof@alap3.anarazel.de
Whole thread Raw
In response to Re: PATCH: two slab-like memory allocators  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: PATCH: two slab-like memory allocators  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
Hi,

> > +typedef struct SlabBlockData *SlabBlock;        /* forward reference */
> > +typedef struct SlabChunkData *SlabChunk;
> >
> > Can we please not continue hiding pointers behind typedefs? It's a bad
> > pattern, and that it's fairly widely used isn't a good excuse to
> > introduce further usages of it.
> >
>
> Why is it a bad pattern?

It hides what is passed by reference, and what by value, and it makes it
a guessing game whether you need -> or . since you don't know whether
it's a pointer or the actual object. All to save a * in parameter and
variable declaration?...

Andres



pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: pg_config --version
Next
From: Gilles Darold
Date:
Subject: Re: Patch to implement pg_current_logfile() function