Skip to content

Commit

Permalink
Merge pull request #12 from manjugv/topic/shmem_malloc_realloc
Browse files Browse the repository at this point in the history
Adding realloc semantics for shmem_malloc_with_hints routine
  • Loading branch information
manjugv authored Jan 31, 2020
2 parents 015e7b9 + 1ed40fe commit 88c948b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions content/shmem_malloc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 88c948b

Please sign in to comment.