Dr W.W. Schulz writes:
> I do not argue for abolishing undefined status for pointers but rather
> for a possibility to test such a state. This is a bit like testing for
> NaNs of real variables (and AFAIK F2000 will provide some support for
> IEEE exceptions for IEEE compliant compilers).
I don't see that these are at all comparable. The compiler run-times
can test for a NaN by just looking at the bit pattern of the value.
Implementation is fundamentally trivial. How do you test whether the
target of a pointer is still valid (without adding a lot of overhead
to every pointer operation)?
I'd say this is much more like testing whether the value of a variable
is defined. You can't just look at the bit pattern and tell whether
the value is a properly defined one or just garbage bits off of the stack.
Note that, once NaN values are allowed in the standard, a variable
defined with a NaN value is still defined. This is fundamentally
different from being undefined.
For variables, it is at least possible to carry around an auxillary
piece of data that keeps track of definition status. 'Tis a bit of
overhead in both time and space, but mostly doable (substantially
complicated by things like common/equivalence, where things of
different types may be equivalenced of partially equivalenced). It
wouldn't be quite this simple for pointers.
Anyway, regardless of analogies, how would you propose this be
implemented? Lacking a plausible implementation strategy, it isn't
going to happen. And strategies that require garbage collection are
unlikely to be considered "plausible" by at least some people - I know
that garbage collection was high on the list of concerns of some of
"our" (Dryden's) people working with real-time applications. They
were majorly concerned at the possibility that a garbage collection
might cause unpredictable performance. Unpredictability is critical to
them - the real-time folk want to be able to guarantee that they will
meet the frame time requirements every time, not just most of the time
or on the average.
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|