From 1ed40fe556b47bd30e5ea3aac70dc2a3ea27c7e8 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Thu, 30 Jan 2020 13:52:13 -0800 Subject: [PATCH] Adding clarification to realloc while memory is allocated via hints --- content/shmem_malloc.tex | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/content/shmem_malloc.tex b/content/shmem_malloc.tex index 17a004d1a..ccb799b14 100644 --- a/content/shmem_malloc.tex +++ b/content/shmem_malloc.tex @@ -45,13 +45,16 @@ The \FUNC{shmem\_realloc} routine changes the size of the block to which \VAR{ptr} points to the size (in bytes) specified by \VAR{size}. The contents - of the block are unchanged up to the lesser of the new and old sizes. If the new - size is larger, the newly allocated portion of the block is + of the block are unchanged up to the lesser of the new and old sizes. + The \FUNC{shmem\_realloc} routine preserves allocation hints, e.g. if `ptr` + was allocated by \FUNC{shmem\_malloc\_with\_hints}. + If the new size is larger, the newly allocated portion of the block is uninitialized. If \VAR{ptr} is a null pointer, the \FUNC{shmem\_realloc} routine behaves like the \FUNC{shmem\_malloc} routine for the specified size. If \VAR{size} is \CONST{0} and \VAR{ptr} is not a null pointer, the block to which it points is freed. If the space cannot - be allocated, the block to which \VAR{ptr} points is unchanged. + be allocated or if hints cannot be preserved, the block to which \VAR{ptr} + points is unchanged. The \FUNC{shmem\_malloc}, \FUNC{shmem\_align}, \FUNC{shmem\_free}, and \FUNC{shmem\_realloc} routines are provided so that multiple \acp{PE} in a program can allocate symmetric,