logoalt Hacker News

0c3ca83 • yesterday at 5:20 PM • 2 replies • view on HN

how does that prevent use after free? pretty sure your algorithm is either very poorly explained or doesnt' actually work.


Replies

jordan_bonecut • yesterday at 5:40 PM

Another thing - when a value is moved or dropped the plane’s type changes from T to shape(T). shape(T) contains unspecified data but has the size and alignment of a T. So you couldn’t safely prove that a moved out/dropped shape(T) is a T

➕ show 1 reply
jordan_bonecut • yesterday at 5:32 PM

The compiler tracks all of the currently living planes. The compiler tracks from which plane each borrow is borrowed. Once the plane it is borrowed from dies that borrow is no longer valid