4 ms·
I also missed the specific solution the first time, but see figure 10 on page 6 (in section 3.1, the pages aren't numbered). It's doing a variant of what I desc
by Jtsummers 5y ago
I also missed the specific solution the first time, but see figure 10 on page 6 (in section 3.1, the pages aren't numbered). It's doing a variant of what I described, in this case they're doing this (copied the document, pseudocode):
function vtable_allocate(self, size) =
let object = allocateMemory(PointerSize + size)
object := object + PointerSize
object[-1] := self
return object
This will guarantee that the memory is contiguous and properly allocated to the process so it's not using garbage data.