logoalt Hacker News

afdbcreid • today at 7:01 AM • 1 reply • view on HN

Nice, didn't know that!


Replies

dwattttt • today at 7:37 AM

It's a safe/stable operation to derive a more limited capability (pointer) from a more capable one. An example would be an arena allocator having a pointer valid for the whole arena, but then only handing out a derived pointer that's valid for the size requested.

You can also limit access permissions IIUC; I'm only going by old memory hear, but you'd be able to hand out a read-only pointer derived from an RWX pointer.