logoalt Hacker News

dwattttt • today at 7:37 AM • 0 replies • view on HN

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.