Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
huonw opened this issue Nov 16, 2015 · 0 comments

Comments

@huonw
Copy link
Member

huonw commented Nov 16, 2015

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.

@huonw huonw added the A-docs label Nov 16, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 16, 2015
Fixes rust-lang#29853
Fixes rust-lang#29852

While these points are true, we're not going for 100% accuracy here,
this is introductory material. Changing these things would be more
confusing, but it is important to note that we're presenting an
abstraction here.
bors added a commit that referenced this issue Nov 17, 2015
Fixes #29853
Fixes #29852

While these points are true, we're not going for 100% accuracy here,
this is introductory material. Changing these things would be more
confusing, but it is important to note that we're presenting an
abstraction here.

r? @huonw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant