T_realloc
346 RSA BSAFE Crypto-C Library Reference Manual
T_realloc
Description
T_realloc changes the size of
block
to
len
. It allocates a memory block of length
len
bytes, copies as many bytes as possible from the old memory block to the new one,
and frees the old block. The address of the new block can be different from the
address of the old block. The value of
len
can be zero, in which case T_realloc returns
a valid non-
NULL_PTR value. On error,
block
is freed. Note that many implementations
of
realloc do not free the block on error, so T_realloc must to do this. The value of
block
is allocated with T_malloc or reallocated with T_realloc, or it is NULL_PTR. If
block
is NULL_PTR, T_realloc performs as T_malloc.
Return value
POINTER T_realloc (
POINTER block, /* block address */
unsigned int len /* new length */
);
Value Description
address of new block Operation was successful.
NULL_PTR
error