Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
realloc32(3) OSS Library Calls Reference Manual
NAME
realloc32 - Reallocates memory
LIBRARY
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <sys/types.h>
#include <stdlib.h>
void _ptr32 *realloc(
void _ptr32 ∗∗old_space,
unsigned int bytes_wanted);
PARAMETERS
old_space Points to the block of memory that was returned by a memory allocation func-
tion.
bytes_wanted Specifies the number of bytes of memory.
DESCRIPTION
The realloc32( ) function is used by 64-bit applications to allocate space from the secondary 32-
bit addressable heap resource.
The realloc32( ) function changes the size of the block of memory pointed to by the old_space
parameter to the number of bytes specified by the bytes_wanted parameter, and returns a pointer
to the block. The contents of the block remain unchanged up to the lesser of the old and new
sizes. If necessary, a new block is allocated, and data is copied to it. If the old_space parameter
is a null pointer, the realloc32() function simply allocates a new block of the requested size. If
the bytes_wanted parameter is 0 (zero), the realloc32() function frees the specified block in the
old_space parameter. If the old_space parameter is a null pointer and the bytes_wanted parame-
ter is 0 (zero), the function returns a null pointer.
RETURN VALUES
This allocation function returns a pointer to space suitably aligned for storage of any type of
object. Cast the pointer to the type pointer-to-element before using it.
The realloc32( ) function returns a null pointer if there is no available memory or if the memory
area has been corrupted by storing outside the bounds of a block. When this happens, the block
pointed to by the pointer parameter could be destroyed.
ERRORS
If any of the following conditions occurs, the realloc32( ) function sets errno to the correspond-
ing value:
[ENOMEM] There is not enough storage memory in the system.
RELATED INFORMATION
Functions: calloc32(3), free32(3), malloc32(3).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to define. In the HP imple-
mentation, the realloc32() function returns a null pointer if the size parameter is 0 (zero).
5−152 Hewlett-Packard Company 527187-017