[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] enforced immutability - proposed research project

From: Elijah Stone
Subject: Re: [Tinycc-devel] enforced immutability - proposed research project
Date: Mon, 18 Jan 2021 17:43:33 -0800 (PST)

On Tue, 19 Jan 2021, Bruno Haible wrote:

MAP_FIXED is a portability nightmare nowadays, where most OSes implement address space randomization and put the shared libraries at arbitrary and random locations in the address space. You better stay away from it.

The implementation I pointed to therefore doesn't use MAP_FIXED, just plain MAP_SHARED.

The problem is, without a fixed offset between the mutable and immutable spaces, certain desirable semantics become harder to implement. For example, we want mutable and immutable references to the same object to compare equal.

One potential solution is to rely on overcommit. Map a giant memory region, and then remap the second portion (using MAP_FIXED) to alias the first half. (Using MAP_FIXED to overwrite existing address space mappings _is_ a supported usage.)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]