Support for 64-bit pointers

Florian Weimer fw at deneb.enyo.de
Fri Jan 1 13:04:36 UTC 2021


* Radosław Smogura:

> In current version of implementation (many places), there’s a lot of
> range checks. However longs in Java are signed, and C pointers are
> unsigned so, at least for x86-64 architectures this should be taken
> on account, otherwise we would not be able to address whole memory
> in straightforward way (largest block size is 2^31, can directly
> address upper half of memory).

The x86-64 architecture actually has signed addresses in the sense
that some number of upper bits of pointers must match the sign bit.
On Linux, userspace addresses always have a zero sign bit.  I think
this is not true on Solaris.  I don't know about Windows.

On some architectures, C struggles with similar issues because
ptrdiff_t is signed and does not cover the entire address space.  It's
therefore undefined to create objects whose size is greater than what
can be expressed as a ptrdiff_t value, despite the underlying
architecture supporting this.


More information about the panama-dev mailing list