[M3devel] LONGINT

Tony Hosking hosking at cs.purdue.edu
Wed Aug 8 00:05:03 CEST 2007


Just responding to this w.r.to what I have implemented.

On Jul 19, 2007, at 5:33 PM, Rodney M. Bates wrote:

>
>
> Randy Coleburn wrote:
>> Tony:
>>  I'd like to better understand the implications of your change as  
>> I do use LONGINT as an index in some applications.
>
> Do you have arrays that need 64-bit subscripts on a 32-bit machine?

You can use a subrange of LONGINT for array indexes.  The effective  
offset of an array element is still computed as an integer.   Arrays  
are restricted in size, as they are currently.

> Allow me the common assumption that both integers and addresses have
> the native word size on most machines.  In this case, most arrays that
> need 64-bit subscripts would exceed the virtual address space of the
> machine.  Exceptions would require elements of size at most a byte,
> and overall sizes in excess of half the virtual address space. Even
> PACKED ARRAY [..] OF BITS 1 FOR BOOLEAN would need to use 1/8 the
> virtual space before 32-bit subscripts ran out.  All this seems pretty
> unlikely.

Integers and addresses have the native word size.

> I would favor keeping INTEGER as the type of open array subscripts
> and not allowing LONGINT to be a fixed array subscript type.  It
> saves a whole lot of language complexity, and doesn't disallow much.

I have done this.

> If it really mattered, you could still use unsafe techniques for
> such memory-hogging arrays.  This might be a reason to extend unsafe
> arithmetic on ADDRESS to accept LONGINT second operands.  This is
> actually consistent with the rest of the operator generalizations.
>>
>
> -- 
> -------------------------------------------------------------
> Rodney M. Bates, retired assistant professor
> Dept. of Computer Science, Wichita State University
> Wichita, KS 67260-0083
> 316-978-3922
> rodney.bates at wichita.edu




More information about the M3devel mailing list