2 ms·
The borrow checker works irrespective of the heap. Memory safety involves all pointers, not just ones that own a heap allocation.
by steveklabnik 2y ago
The borrow checker works irrespective of the heap. Memory safety involves all pointers, not just ones that own a heap allocation.
- o11c 2y agoIf we're trying to minimize annotation while maximizing C compatibility, it will be necessary to heap-allocate stack frames. This cost can be mitigated with annotations, once again. In this case, a global "forbid leaks even if unused" flag would cover it. Static allocations only need full heap compatibility if `dlclose` isn't a nop. And TLS is the forgotten step-child, but at the lowest level it's ultimately just implemented on normal allocations.
- dwattttt 2y ago> it will be necessary to heap-allocate stack frames. I sure hope you don't use any stack frames while writing the stack frame allocator.