Re: Isn't HANDLE 64 bits on Win64?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Isn't HANDLE 64 bits on Win64?
Дата
Msg-id 27296.1289918561@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Isn't HANDLE 64 bits on Win64?  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: Isn't HANDLE 64 bits on Win64?  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> On Tue, Nov 16, 2010 at 11:01, Magnus Hagander <magnus@hagander.net> wrote:
>> So yes, it looks completely broken. I guess Windows doesn't actually
>> *assign* you a handle larger than 2^32 until you actually ahve that
>> many open handles. Typical values on my test system (win64) comes out
>> at around 4000 in all tests.

> Patch applied for this and backpatched to 9.0.

I did a bit of googling and found some references claiming that Win64
will never assign system handles that are outside the range
representable as a signed long; and further stating there are standard
macros HandleToLong and LongToHandle to perform those conversions.
So I'd be comfortable with the original coding as long as we used those
macros instead of random casting.  Dunno if you think that'd be cleaner
than what you did.  (It's also a fair question whether those macros
are available on Win32.)
        regards, tom lane


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: track_functions default
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Isn't HANDLE 64 bits on Win64?