HPlogo HP C/HP-UX Release Notes for HP-UX 10.20: HP 9000 Computers > Chapter 4 Problem Descriptions and Fixes

Memory Allocation Routine alloca()

» 

Technical documentation

Complete book in PDF

 » Table of Contents

The implementation of this alloca() routine can be very system dependent and its use is not encouraged.

alloca() is a memory allocation routine similar to malloc() (see malloc(3C)). The syntax is:

void *alloca(size_t size);

alloca() allocates space from the stack of the caller for a block of at least size bytes, but does not initialize the space. The space is automatically freed when the calling routine exits. This routine is implemented as an inlined function by the HP C compiler product.

To use this function, you may use the <alloca.h> header file or you may specify your own prototype and use the +Olibcalls option.

© 1998 - Hewlett-Packard Development Company, L.P.