BUFFER_LOCK_* synonyms

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: BUFFER_LOCK_* synonyms
Date: 2015-09-16 15:31:48
Message-ID: CAMkU=1xTWfZUNPcegy1e4WSOEKAZS9A2gZJveHzgJbVC17RsEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

All of the index methods have their own synonyms of the BUFFER_LOCK_*
constants, for example:

#define GIN_SHARE BUFFER_LOCK_SHARE
#define GIST_SHARE BUFFER_LOCK_SHARE
#define HASH_READ BUFFER_LOCK_SHARE
#define BT_READ BUFFER_LOCK_SHARE

But most of them pass their constants directly to LockBuffer. So if they
were ever defined to be anything else, things would fall apart pretty
comprehensively. (Hash index also passes them to LockBuffer, but only
indirectly via some utility functions).

What does this pseudo-encapsulation get us? It seems like we have a
separation of spelling, but no real separation of concerns.

Cheers,

Jeff

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-09-16 15:32:38 Re: pltcl: sentence improvement
Previous Message Euler Taveira 2015-09-16 15:16:37 Re: pltcl: sentence improvement