pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Petr Jelinek <petr@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: John Gorman <johngorman2@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: PATCH: two slab-like memory allocators
Date: Sun, 27 Nov 2016 12:47:40 -0800
Message-ID: <20161127204740.dr3swudwsbafjuof@alap3.anarazel.de> (raw)
In-Reply-To: <efd47210-cf95-d7ee-e984-a873f76596a8@2ndquadrant.com>
References: <b8ded0aa-2515-7ffd-162b-8f515df5eca1@2ndquadrant.com>
	<CA+Tgmob7u4thiBbdvyseQk1aVApJeG10C_rFFt8LPV03-UzD7g@mail.gmail.com>
	<a4593432-c989-8ec4-2320-943e3f97ce6d@2ndquadrant.com>
	<CA+TgmobJrM74FRTcmn2JDMVbLB0a5pj5e3ieLBMzkDNtrxF4dw@mail.gmail.com>
	<9818b54a-fcb6-f018-0b16-96d6a1d1da27@2ndquadrant.com>
	<34a6d4ea-7f3d-a62c-fff1-7a9108c078d7@2ndquadrant.com>
	<f2aaf4a5-412c-a4b9-389d-c9f682fbdc77@2ndquadrant.com>
	<4f176a6c-c197-165d-dee4-5de8f279f1f4@2ndquadrant.com>
	<20161112191257.3a4n6kzegvu637qn@alap3.anarazel.de>
	<efd47210-cf95-d7ee-e984-a873f76596a8@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
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 (97+ messages)  latest in thread

Message-ID: <20161127204740.dr3swudwsbafjuof@alap3.anarazel.de>
Permalink:  ../20161127204740.dr3swudwsbafjuof@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20161127204740.dr3swudwsbafjuof@alap3.anarazel.de

 · 

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: andres@anarazel.de, tomas.vondra@2ndquadrant.com, petr@2ndquadrant.com, robertmhaas@gmail.com, johngorman2@gmail.com
  Subject: Re: PATCH: two slab-like memory allocators
  In-Reply-To: <20161127204740.dr3swudwsbafjuof@alap3.anarazel.de>

* 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