|
 |
Mike Raiford wrote:
> Warp wrote:
>> Manuel Kasten <kas### [at] gmx de> wrote:
>>> If you only allow safe-mode managed code, pointer arithmethic is not
>>> possible.
>>
>> So you can't have arrays?
>>
>
> You can, but not in the sense of a contiguous block of memory containing
> the data sense.
Actually, yes, you can. You just bounds-check the array. You can do
that in a C implementation, even. People just don't for some reason.
Indeed, the language they use for the OS has "representation structures"
which are specifically designed to (for example) land in certain
memory-mapped hardware bits.
There's no problem supporting arrays. Arrays are objects. The problem is
supporting arbitrary untyped pointers assigned non-pointer values -
i.e., the problem is casting an integer to a pointer.
> The question I have is what if I want to develop an application (such as
> a high performance image analysis package) against a platform that uses
> only managed code. Could it be done using the CPU the most efficiently?
Sure, why not? If the compiler can prove you're not violating the memory
constraints, why not? Note that their tests show it's actually more
efficient to check in software than in hardware, and the software checks
are pretty efficient.
> If I were restricted to "safe" code, is there a way to remove that
> restriction for that app?
No. That's the point.
I mean, I suppose, sure, you could. But it's not going to be a regular
app. You'd need to install it differently and prove you're allowed to.
That's how the kernel, for example, works. It's like asking "can I
write code in a Linux app that bypasses the memory mapping hardware?"
Sure, but it's far from normal.
--
Darren New / San Diego, CA, USA (PST)
Ever notice how people in a zombie movie never already know how to
kill zombies? Ask 100 random people in America how to kill someone
who has reanimated from the dead in a secret viral weapons lab,
and how many do you think already know you need a head-shot?
Post a reply to this message
|
 |