pub fn allocator(self: *Self) Allocator {
return .{
.ptr = self,
.vtable = &.{
.alloc = alloc,
.resize = resize,
.free = free,
},
};
}
this excerpt is from std.heap.GeneralPurposeAllocator. in particular, I am confused by the vtable initialization. My newbie eyes are inclined to read this as creating a new allocator vtable on the stack, and taking the address of that, and returning it to the caller. But this obviously works, and so I'd like some help correcti8ng my reading of this.