Sujet : Re: Memory protection between compilation units?
De : mateusz (at) *nospam* x.invalid (Mateusz Viste)
Groupes : comp.lang.cDate : 12. Jun 2025, 13:41:03
Autres entêtes
Organisation : ...
Message-ID : <20250612144103.4c065250@mateusz>
References : 1 2
User-Agent : Claws Mail 4.2.0 (GTK 3.24.43; x86_64-suse-linux-gnu)
On Wed, 11 Jun 2025 17:19 Opus wrote:
There is a proposed extension for the RISC-V ISA called CHERI that
offers the kind of fine-grained memory protection that could fit your
purpose here.
CHERI was indeed one of the first links that google offered when I
tried looking for an existing solution. But as you noted, it's not
available on "normal" hardware, and sadly google wasn't able to propose
any more "real-world" alternatives.
Second note: you chose to wrap indices around to handle possible
out-of-bounds accesses. That may or may not be a good idea depending
on the exact context. You may alternatively want to do nothing if val
is out of bounds
This was about a primitive 64K hash map, so out of bounds situations
were expected impossible to happen... if the programmer hadn't
sized his array 1 entry too short.
Mateusz