C++ Logo

std-proposals

Advanced search

Re: [std-proposals] <type_traits> std::contains_mutable

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 14 Nov 2025 11:18:57 -0800
On Friday, 14 November 2025 07:59:48 Pacific Standard Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> But I'm not only talking about microcontrollers here. On desktop PC's,
> you can create an object and then change the permissions on the page
> of memory to read-only.

"Voids warranty" type of problem. If you do something dangerous and you break
things, you get to keep both pieces.

You can change permissions on pages, sure. But imagine that the page was read-
only for a reason, such as a DAX/Flash mapped file from read-only storage. If
did make that page writable and the OS wasn't prepared to do copy-on-write,
you'd still get a crash for writing to the page: the MMU would attempt to
write, but the actual backing device wouldn't allow it.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2025-11-14 19:19:01