They do happen in all real world C projects of non-trivial size though. Even when abstracting most forms of lifetime management.
-
-
Replying to @CopperheadOS
You either use single-owner/single-reference, or refcounting. Anything else is idiotic.
1 reply 0 retweets 1 like -
Replying to @RichFelker
Or you use a language like Rust permitting you to do stuff like allocation-free parsing via lots of lightweight safe references.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
It's fine if the compiler tracks the origin of the lifetimes and enforces it. People use C for performance so they will do more.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
Reference counting can also be done wrong. The Linux kernel gets it wrong all over the place even when reusing code for it.
2 replies 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
Tools really need to enforce the correct way of doing things. Can have the option of defining new correct mechanisms though.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
People simply aren't going to get it right without it being enforced. Even if it's a single person and they are really trying.
2 replies 0 retweets 1 like -
Replying to @CopperheadOS @RichFelker
Threads make everything so much harder too. Rust maintains memory safety with threading even while allowing shared mutable data.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
Threads pretty much have to be forbidden if you want solving the problems to be simple. Otherwise type system needs a lot more.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
Reference counting has to all be atomic ops with locking mutable data forced unless you have fancy stuff like Send/Sync, etc.
1 reply 0 retweets 0 likes
Lock, inc/dec, unlock works just as well as atomics for the refcnt.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.