Skip to content

Commit bb43f58

Browse files
committed
Document heap allocation location guarantee
1 parent 2af3dd7 commit bb43f58

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/doc/reference.md

+3
Original file line numberDiff line numberDiff line change
@@ -3909,6 +3909,9 @@ The _heap_ is a general term that describes boxes. The lifetime of an
39093909
allocation in the heap depends on the lifetime of the box values pointing to
39103910
it. Since box values may themselves be passed in and out of frames, or stored
39113911
in the heap, heap allocations may outlive the frame they are allocated within.
3912+
An allocation in the heap is guaranteed to reside at a single location in the
3913+
heap for the whole lifetime of the allocation - it will never be relocated as
3914+
a result of moving a box value.
39123915

39133916
### Memory ownership
39143917

0 commit comments

Comments
 (0)