# \`freeze(MaybeUninit\<T\>) -\> MaybeUninit\<T\>\` for masked reads

**URL:** <https://internals.rust-lang.org/t/freeze-maybeuninit-t-maybeuninit-t-for-masked-reads/17188>\
**Category:** language design\
**Created:** [August 13, 2022, 10:41pm UTC](https://internals.rust-lang.org/t/freeze-maybeuninit-t-maybeuninit-t-for-masked-reads/17188 "2022-08-13T22:41:48Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![toc](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/toc/32/6692_2.png) [@toc](https://internals.rust-lang.org/u/toc)\
**Post date:** [August 17, 2022, 3:23pm UTC](https://internals.rust-lang.org/t/freeze-maybeuninit-t-maybeuninit-t-for-masked-reads/17188/25 "2022-08-17T15:23:48Z")

</div>

> [@lachlansneff](#):
>
> Why is it necessary to deal with MADV\_FREE here?

There's some good discussion about this in

> [@"What The Hardware Does" is not What Your Program Does: Uninitialized Memory](https://internals.rust-lang.org/t/what-the-hardware-does-is-not-what-your-program-does-uninitialized-memory/10561):
>
> This post is about uninitialized memory, but also about the semantics of highly optimized “low-level” languages in general. I will try to convince you that reasoning by “what the hardware does” is inherently flawed when talking about languages such as Rust, C or C++. [https://www.ralfj.de/blog/2019/07/14/uninit.html](https://www.ralfj.de/blog/2019/07/14/uninit.html) ([edit history](https://git.ralfj.de/web.git/history/refs/heads/master:/ralf/_posts/2019-07-14-uninit.md))

General `MaybeUninit::freeze` is going to have to deal with everything brought up there.

---

_[View the full topic](https://internals.rust-lang.org/t/freeze-maybeuninit-t-maybeuninit-t-for-masked-reads/17188)._
