Understanding the basic idea of uninitialized memory

โš“ Rust    ๐Ÿ“… 2025-09-16    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 10      

surdeus

Warning

This post was published 47 days ago. The information described in this article may have changed.

Reading this only OoC, since I know 0 about the lower levels or hardware.

But I did wonder, can the idea be represented as a single diagram? Or maybe simplified a bit for beginners?

One seems clear:

let a:u8;

Can not be read in safe Rust. It can in unsafe Rust, I think? And either way, it does not contains random bit pattern.

It seems one needs to imagine a Rust AM rather than hardware. A separate model where bytes have a 2nd state of "unitialized" but after going through I am still unsure what to imagine in its place.

It is like an extra abstraction on top of a raw byte contents ? Because, I dont think imagining actually uninitialized memory makes sense, since it will always be something.

8 posts - 5 participants

Read full topic

๐Ÿท๏ธ Rust_feed