Ring1_Memory_reallocateArray
Reallocate a memory block.
Ring1_Result
Ring1_Memory_reallocateArray
(
void **result,
void *p,
size_t numberOfElements,
size_t elementSize
)
This function reallocates a memory block of to numberOfElements * elementSize
Bytes.
In particular, this function fails if p
is a null pointer.
If this function fails, then the existing memory block is not modified.
Parameter variables
result
- A pointer to a pointer a
void *
variable. p
- A pointer to a pointer to a memory block.
numberOfElements, elementSize
- The product
numberOfElements * elementSize
is the size, in Bytes, of the memory block to allocate.
Return Values
Ring1_Result_Success
on success, Ring1_Result_Failure
on failure.
Post Conditions
If this function fails, then it sets the by-thread status variable.
Below is a list of failure conditions and the status codes indicating them.
Ring1_Status_InvalidArgument
result
isNULL
Ring1_Status_InvalidArgument
p
isNULL
Ring1_Status_AllocationFailed
- the allocation failed
Ring1_Status_NumericOverflow
numberOfElements * elementSize
overflows
If this function fails, result
is not dereferenced.
If this function succeeds, *result
is assigned a pointer to the reallocated memory block
of n
Bytes.