Skip to content

Commit 2750e3c

Browse files
committed
Add note about pointer state after the call.
Fixes #23422
1 parent 0834bd1 commit 2750e3c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/liballoc/heap.rs

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 {
2626
///
2727
/// On failure, return a null pointer and leave the original allocation intact.
2828
///
29+
/// If the allocation was relocated, the memory at the passed-in pointer is
30+
/// undefined after the call.
31+
///
2932
/// Behavior is undefined if the requested size is 0 or the alignment is not a
3033
/// power of 2. The alignment must be no larger than the largest supported page
3134
/// size on the platform.

0 commit comments

Comments
 (0)