I am reading rusty_v8's source code.
And I found this code:
let vtable: &'static RustAllocatorVtable<AtomicUsize> =
&RustAllocatorVtable {
allocate,
allocate_uninitialized,
free,
reallocate,
drop,
};
https://github.com/denoland/rusty_v8/blob/main/src/array_buffer.rs#L205
I was confused that why &RustAllocatorVtable{}
had static lifetime. It allocated on stack and will destroyed after the function scope, isn't it?