From bb43f580e5a291ee02a99b6dca6ec9b757151a19 Mon Sep 17 00:00:00 2001 From: Aidan Hobson Sayers Date: Sun, 20 Mar 2016 23:12:20 +0000 Subject: [PATCH] Document heap allocation location guarantee --- src/doc/reference.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/doc/reference.md b/src/doc/reference.md index 4c5fd31b96e..cdf54b39e68 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -3909,6 +3909,9 @@ The _heap_ is a general term that describes boxes. The lifetime of an allocation in the heap depends on the lifetime of the box values pointing to it. Since box values may themselves be passed in and out of frames, or stored in the heap, heap allocations may outlive the frame they are allocated within. +An allocation in the heap is guaranteed to reside at a single location in the +heap for the whole lifetime of the allocation - it will never be relocated as +a result of moving a box value. ### Memory ownership