[Cython] Hash-based vtables

Sturla Molden sturla at molden.no
Tue Jun 19 13:25:02 CEST 2012


On 12.06.2012 21:46, Dag Sverre Seljebotn wrote:

> But for much NumPy-using code you'd typically use int32 or int64, and
> since long is 32 bits on 32-bit Windows and 64 bits on Linux/Mac,
> choosing long sort of maximises inter-platform variation of signatures...

The size of a long is compiler dependent, not OS dependent.

Most C compilers for Windows use 32 bit long, also on 64-bit Windows for 
AMD64. The reason is that the AMD64 architecture natively uses a "64-bit 
pointer with a 32-bit offset". So indexing with a 64-bit offset could 
incur some extra overhead. (I don't know how much, if any at all.)

On IA64 the C compilers for Windows use 64 bit long, because the native 
offset size is 64 bit.

The C standard specify that a long is "at least 32 bits". Any code that 
assumes a specific sizeof(long), or that a long is 64-bits, does not 
follow the C standard.

Sturla


More information about the cython-devel mailing list