|
|
Log in / Subscribe / Register

Memory-safe C code

Memory-safe C code

Posted Nov 16, 2025 0:45 UTC (Sun) by Cyberax (✭ supporter ✭, #52523)
In reply to: Memory-safe C code by alx.manpages
Parent article: Rust in Android: move fast and fix things (Google Security Blog)

Macros in C can only buy you safe array access, but they can't prevent use-after-free. Unless you go into full automatic reference counting for all objects (i.e. performance killer). And you can't do really anything about concurrency.


to post comments

Memory-safe C code

Posted Nov 16, 2025 6:55 UTC (Sun) by alx.manpages (subscriber, #145117) [Link]

Agree.

I suspect we could probably add some attributes or qualifiers to get Rust-like semantics that prevent use-after-free.

But even if we only get rid of buffer overflows, that would still be an important change.

BTW,

> Macros in C can only buy you safe array access

Even safe array parameter (thus, pointer) access, after some feature I'm working on.


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