Re: PHP3 and 64-bit land
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: PHP3 and 64-bit land | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-4348@lists.php.net to get a copy of this message | ||
> > Resources use hash tables to store themselves, and they usually use the
> > numeric indices. I think it's extremely safe to use 32-bit integers as
> > unique identifiers for 64-bit pointers, by simply casting them. You'd
> > have to be extremely unlucky to bump into a problem because of this data
> > loss. Your chances of winning the lottery are much much bigger.
>
> I disagree here. The chance of having the same ptr in 32 bit is about 1 in
> 2^32 = 4,294,967,296. If you come to Germany, your chance to win the lottery
> ("6 aus 49") is about 1 to 49!/43! = 10,068,347,520.
>
> It's extremly safe, but you risk random, non repeatable crashes produced by
> playing that way.
Would there be a big drawback to using a long here instead of an int for
unique identifiers?
-Rasmus
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net