Skip to content

Sometimes reuse stack addresses #3487

Open
@RalfJung

Description

@RalfJung

In real executions, when a function returns and the same function is called again, variables will often get the same address again. In Miri this never happens; address reuse is disabled for stack variables currently. This is because the reuse pool is shared among all threads, and address reuse induces synchronization, so by reusing stack addresses from different threads we basically kill weak memory emulation and data race detection as everything is always synchronized.

We could still do address reuse for stack allocations within the same thread though. This should probably be a separate per-thread reuse pool. Stack allocations are very common so we need to be careful with the performance impact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-interpreterArea: affects the core interpreterC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions