> Usize is an unsigned integer which can hold the maximum size of an
> object declared statically (the sizeof operator returns a value of
> type usize) or created by the usual allocation functions (the size
> argument of malloc is - or should be?  - type usize).  Usize may be
> smaller than uintptr, for example on amd64 where uintptr is 64 bits
> and usize is 32.  On such machines it may still be possible to
> make larger allocations (eg by writing a megamalloc function
> with a size argument in megabyte units) but not to use a usize
> variable to represent the length of the returned objects.

unfortuntely, most of this is either not true yet, or the goal is to
make it false.  the current signature of malloc is void* malloc(ulong),
the goal is to make it void* malloc(usize), additionally usize is
always ulong now, but the goal is to make it 64-bits on amd64,
and perhaps other 64-bit architectures.

therefore, i wanted to emphasis what it should be, and that the current
situtation must change.  terrible, no?  is there a better way?

(you can get a large hunk of memory with segbrk, which is cheating
and probablly dangerous.)

- erik

Reply via email to