|
|
Subscribe / Log in / New account

A pair of Rust kernel modules

A pair of Rust kernel modules

Posted Sep 14, 2022 3:08 UTC (Wed) by khim (subscriber, #9252)
In reply to: A pair of Rust kernel modules by NYKevin
Parent article: A pair of Rust kernel modules

If language is serious about memory leaks then it have to provide tools which leak memory.

This may sound paradoxical, but it's not. If you define “memory leak” as something crazy and mostly useless (like tracing-GC languages do: it's not a memory leak if objects can be accesses by “live pointers”… even if program have no code which may actually ever access these objects) then you may “prevent them” but this wouldn't do anyone any good.

Either your language allows memory leaks by losing track of which event handlers you've forgotten to unregister or it's not a general-purpose language.

And if you admit that layman-definition memory leaks (as in: something which takes infinite amount of memory as time goes on is a memory leak, period) are impossible to prevent then having function which is specifically dedicated to creating persistent objects is obvious choice: this means that objects generated by that function can be treated specially by sanitizers, etc.

Lisps typically have these these to implement interning, e.g.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds