From 2750e3c83e7cfbad779877ac213bd815c6aa65bb Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 20 Mar 2015 15:22:57 -0400 Subject: [PATCH] Add note about pointer state after the call. Fixes #23422 --- src/liballoc/heap.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index aaf6e76237ca5..3733350412e49 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -26,6 +26,9 @@ pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 { /// /// On failure, return a null pointer and leave the original allocation intact. /// +/// If the allocation was relocated, the memory at the passed-in pointer is +/// undefined after the call. +/// /// Behavior is undefined if the requested size is 0 or the alignment is not a /// power of 2. The alignment must be no larger than the largest supported page /// size on the platform.