News for hackers. Stuff that matters.
Re:Handles Are the Better Pointers by kazinator on Wednesday June 21, 2023 @01:02PM (#36421217)
> Once the generation counter would ‘overflow’, disable that array slot, so that no new handles are returned for this slot.

This is an interesting idea. When a slot becomes burned this way, you still have lots of other slots in the array. The total number of objects you can ever allocate is the number of slots in the array times the number of generations, which could be tuned such that it won't exhaust for hundreds of years.

You only have to care about total exaustion: no free slot remains in the array: all are either in use, or burned by overflow. In that case, burned slots can be returned into service, and we hope for the best.

If the total exhaustion takes centuries, the safety degradation from reusing burned slots (exposure to undetected use-after-free) is only academic.

There are no comments on this comment yet.