Hacker News
points by nickwanninger 4 days ago | 0 comments
My PhD thesis is on this topic, and I had an ASPLOS paper on handle based memory support in unmanaged languages (C/C++) through LLVM a few years ago: https://nickw.io/papers/asplos24-alaska.pdf

The overhead we saw there is suprisingly just from instruction and branch overhead from using software handles - I have ongoing work to do it in hardware and the overheads are much lower.

[–] nostrademons 4 days ago
Note that the terminology in this article is somewhat non-standard. I usually think of a handle as a pointer-to-a-pointer: it adds another level of indirection so that memory allocator can move objects in memory without needing knowledge of all outstanding pointers. IIRC the classic Mac Toolbox (~1990) used them extensively, and that concept seems to be what your Ph.D thesis is about.

The objects discussed in this article would probably be better called "descriptors". They're very much analogous to file descriptors in UNIX: the API returns an integer index into a table, which contains the actual data being referenced. The memory address of the table or its members remains opaque to calling code, and there is no way to access outside the bounds of the table.

Hacker News