Skip to content

Potential memory leak when running as WASM #1275

@aweiker

Description

@aweiker

In tracking down a memory leak in our code we were able to isolate it down to a few different possibilities (including the upgrade from 1.0.40 to 1.0.41) and it caught my attention that PR #1273 introduced the use of core::hint::unreachable_unchecked() which the documentation states that the compiler may have generated nonsensical machine instructions for this situation, including in seemingly unrelated code, causing difficult-to-debug problems source.

While I haven't had a chance to isolate and provide an easy to reproduce scenario; I thought it worthwhile to ask why this was used instead of the unreachable! macro as the documentation suggests, or worse case just use panic!.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions