Re: space reserved for WAL record does not match what was written: panic on windows

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: space reserved for WAL record does not match what was written: panic on windows
Дата
Msg-id 20131018204618.GA368286@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: space reserved for WAL record does not match what was written: panic on windows  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
On Fri, Oct 18, 2013 at 09:05:38PM +1300, David Rowley wrote:
> As for signed vs unsigned, I've not looked at all of the places where
> MAXALIGN is used, but I just assumed it was for memory addresses, if this
> is the case then I'm confused why we'd ever want a negative valued memory
> address?

The result will invariably be cast to a pointer type before use, at which
point it's no longer negative.  (That's not to say we should keep using signed
math, but it doesn't cause active problems for memory addresses.)

> This might be an obvious one, but can anyone tell me why the casts are in
> the macro at all? Can a compiler not decide for itself which type it should
> be using?

The casts allow passing values of pointer type, which are not valid as
arguments to the bitwise AND operator.

-- 
Noah Misch
EnterpriseDB                                 http://www.enterprisedb.com



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Turning recovery.conf into GUCs
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Turning recovery.conf into GUCs