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
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to