Re: Question about coding of free space map

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about coding of free space map
Дата
Msg-id 18002.1409323202@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question about coding of free space map  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 08/26/2014 05:13 AM, Tatsuo Ishii wrote:
>> While looking into backend/storage/freespace/freespace.c, I noticed
>> that struct FSMAddress is passed to functions by value, rather than
>> reference.

> There isn't really any strict coding rule on that. We pass RelFileNode's 
> by value in many functions, for example.

The only reason RelFileNodes work like that is that Robert blithely
ignored the coding rule when he was revising things to pass those around.
I've never been terribly happy about it, but it wasn't important enough
to complain about.

The cases where it *would* be important enough to complain about would
be performance-critical code paths, which RelFileNode usages typically
don't appear in (if you're messing with one you're most likely going
to do a filesystem access).  I'd be unhappy though if someone wanted
to start passing ItemPointers by value.  I doubt we can rely on C
compilers to pass those as efficiently as they pass pointers.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: LIMIT for UPDATE and DELETE
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Misleading error message in logical decoding for binary plugins