logoalt Hacker News

zamalek • today at 3:51 PM • 3 replies • view on HN

From the file:

>Create with P::new(value). p.get() returns &'static T. [...] unless an explicit recycling site proves them dead

It's unsound, the LLM/human is doing the proving. They've hidden unsafe in an abstraction without removing the unsafeness. Using the arena allocator's lifetime would have been safe and easy (bumpalo recommends this AFAIK).

I'm guessing a sycophantic LLM either found or praised this load-bearing seam.

Never deallocating would have been sound (missile memory management: https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98... ).


Replies

tengbretson • today at 5:43 PM

> Never deallocating would have been sound (missile memory management: https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98... ).

Calling this a breakthrough in memory management is an understatement. Call up the Turing Award committee. We just discovered a solution to the halting problem! Turns out that for certain applications the answer is unequivocally "yes"

afdbcreid • today at 4:13 PM

With sanitizers (https://github.com/oxc-project/tsrs/blob/main/notes/mem-recy...). We're back to C I guess. I hate this project now.

lioeters • today at 4:54 PM

> load-bearing seam

Zing!