Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
malloc32(3) OSS Library Calls Reference Manual
NAME
malloc32 - Allocates 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 *malloc(
unsigned int bytes_wanted);
PARAMETERS
bytes_wanted Specifies the number of bytes of memory to be allocated.
DESCRIPTION
The malloc32( ) function is used by 64-bit applications to allocate space from the secondary 32-
bit addressable heap resource.
The malloc32( ) and free32( ) functions provide a simple, general purpose memory allocation
package.
The malloc32( ) function returns a pointer to a block of memory of at least the number of bytes
specified by the bytes_wanted parameter. The block is aligned so that it can be used for any type
of data. If the bytes_wanted parameter 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 malloc32( ) 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 function sets errno to the corresponding value:
[ENOMEM] There is not enough storage memory in the system.
RELATED INFORMATION
Functions: calloc32(3), free32(3), realloc32(3).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to define. In the HP imple-
mentation, the malloc32( ) function returns a null pointer if the bytes_wanted parameter is 0
(zero).
4−172 Hewlett-Packard Company 527187-017