Re: Double linked list with one pointer

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Double linked list with one pointer
Дата
Msg-id 87he0d0z6w.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на Re: Double linked list with one pointer  ("Dann Corbit" <DCorbit@connx.com>)
Ответы Re: Double linked list with one pointer  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
"Dann Corbit" <DCorbit@connx.com> writes:

> From the C-FAQ:
> 
> A:    Not portably, it doesn't.  It attempts to modify the variable a
>     twice between sequence points, so its behavior is undefined.

> 10.3:    How can I write a generic macro to swap two values?

Neither of these are really relevant, a) he's not talking about swapping
anyways, and b) there's no reason to try to write the linked list code in a
single statement or macro.

> but it will not work for floating-point values or pointers

Treating pointers as integers is technically nonportable but realistically you
would be pretty hard pressed to find any architecture anyone runs postgres on
where there isn't some integer datatype that you can cast both directions from
pointers safely.


Presumably if you wanted to do this you would implement it all in an
abstraction that hid all the details from calling code. You could even
implement gdb functions to help debugging. 


But that's a lot of effort for something postgres didn't even need in the
first place.

-- 
greg



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

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: *sigh*
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Call for pg_dump testing