Skip to content

Commit 7251274

Browse files
aidanhsManishearth
authored andcommitted
Document heap allocation location guarantee
1 parent d36fc2c commit 7251274

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

reference.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3911,6 +3911,9 @@ The _heap_ is a general term that describes boxes. The lifetime of an
39113911
allocation in the heap depends on the lifetime of the box values pointing to
39123912
it. Since box values may themselves be passed in and out of frames, or stored
39133913
in the heap, heap allocations may outlive the frame they are allocated within.
3914+
An allocation in the heap is guaranteed to reside at a single location in the
3915+
heap for the whole lifetime of the allocation - it will never be relocated as
3916+
a result of moving a box value.
39143917

39153918
### Memory ownership
39163919

0 commit comments

Comments
 (0)