John Morrison wrote:
>
> Hi Barry;
>
> Barry Pederson wrote:
> > How about if you added a feature to allow arrays to be created that had
> > their values in particular regions of memory..something like:
> >
> > byte[] getBytes(long address, long length);
>
> JavaOS has a hierarchy of "memory" classes with accessors and mutators like this
> (e.g., they've got a setBytes method).
I didn't mean that the method should make a -copy- of the bytes at the
given address, but rather than a byte array object somehow be created
with the underlying storage at a particular address.
Looking at jbarray.h, I guess what I'm saying is: create an array with
the "myElements" field set to the specified address, and
"myNumberOfElements" to the specified length.
With such a deal, there'd be no need for a "setBytes" method, since
every value stored in the array would go directly where you want it.
It'd be just about as handy as writing code with C pointers, but safer
because of the inherent bounds checking of Java.
Barry
_______________________________________________
Kernel maillist - [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel