alloc

The alloc v4 API method allocates a block of memory.

Declaration

void*alloc(
     a_v4_extfn_proc_context *cntxt,
     size_t len
     )

Usage

Allocates a block of memory of length at least len. The returned memory is 8-byte aligned.
Tip: Use the alloc() method as your only means of memory allocation, which allows the server to keep track of how much memory is used by external routines. The server can adapt other memory users, track leaks, and provide improved diagnostics and monitoring.

Memory tracking is enabled only when external_UDF_execution_mode is set to a value of 1 or 2 (validation mode or tracing mode).

Parameters

Parameter Description
cntxt The procedure context object
len The length, in bytes, to allocate