Skip to content

Use of sequential addresses for heap allocations in Stack v. Heap documentation is somewhat misleading #29853

Closed
@huonw

Description

@huonw

In a typical long-running program that is performing allocations and deallocations as it goes, successive allocations are unlikely to be exactly adjacent in memory, but https://doc.rust-lang.org/stable/book/the-stack-and-the-heap.html may imply that there's more predictability than there is. That said, a normal allocator won't be completely unpredictable.

One suggestion from twitter was to use random numbers for heap allocs.

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