Mill Computing, Inc. Forums The Mill Architecture array bound checking Reply To: array bound checking

Ivan Godard
Post count: 689

There is no direct ISA support for {addr, len} style descriptors. Instead descriptor arithmetic would use the machine width to update both fields independently. The performance would be the same, but does not require 128-bit data paths into the ALU and on the belt. There are many specialized kinds of smart/fat pointers in use, hidden behind the abstractions of the languages. It’s easy to invent one that satisfies a particular set of usage; it’s hard to make it general. For example, how does one get a {addr, len} pointer to iterate backwards? How are they garbage-collected? The ISA is not the place for these questions; the languages are.

There is a mechanism to check the validity of a pointer per the C/C++ rules: points within the object or one element beyond. Violations get you a NaR. However, this is a validity check, not a range check. NYF.