On Thu Nov 22 04:03:29 EST 2012, charles.fors...@gmail.com wrote:
> usize is indeed the same size as uintptr.
> Instead of either for purely integer values, it would be better to
> make all integers 64 bit, and use uint and int (for pointer
> differences),
> but that causes other problems, at the moment.
> 
> On 22 November 2012 03:44, Bruce Ellis <bruce.el...@gmail.com> wrote:
> > i'd like an example of where usize wins, as it has to be same as uintptr

my reading of various standards says that usize doesn't need
to be the same size as uintptr, since the implementation could
limit the address space used to smaller than could be addressed
by the full pointer range.  and in fact due to the inbetween
state of things, usize is 32-bits on nix.  i see the strategy as
first ulong→usize, then redefine usize.

i agree that that's gross.

if we got rid of usize, the type signature of malloc would
be
        void    *malloc(uintptr)
which i think is quite confusing.  imo, types should be as self-
documenting as possible.  

- erik

Reply via email to