Re: suspicious pointer/integer coersion

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: suspicious pointer/integer coersion
Дата
Msg-id 42D51617.6050203@dunslane.net
обсуждение исходный текст
Ответ на suspicious pointer/integer coersion  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
This seems to have gone AWOL in the email ether, so I am resending.

-------- Original Message --------

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>  
>
>>I have just noticed this code in plperl.c:
>>    
>>
>>        hv_store(plperl_proc_hash, internal_proname, proname_len,
>>                 newSViv((IV) prodesc), 0);
>>    
>>
>>basically, here prodesc is a pointer to a struct, and we are storing it 
>>as an integer in a perl hash for easy lookup by stringified oid.
>>
>>How safe is this conversion on 64 bit platforms?
>>    
>>
>
>Not at all.  I'd vote for converting the whole thing to a dynahash
>hashtable ...
>
>  
>


Further investigation yields this from the perlguts man page:
     What is an "IV"?
     Perl uses a special typedef IV which is a simple signed integer type     that is guaranteed to be large enough to
holda pointer (as well as      an integer).
 

So it looks like my original concern was unfounded. Sorry for the noise. 
We now return you to your previous program ...

cheers

andrew




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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: A Guide to Constraint Exclusion (Partitioning)
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: A Guide to Constraint Exclusion (Partitioning)