P99

◆ P99_MALLOC

#define P99_MALLOC (   X)    malloc(sizeof(X))

A type oriented malloc wrapper.

This macro receives an expression that is evaluated for its size.

double * a = P99_MALLOC(double[10]); // allocate an array of 10 double
node * n = P99_MALLOC(*n); // allocate a new node
Remarks
As with the C library routine, the allocated space is uninitialized. Better use P99_CALLOC wherever possible. In particular, as in the second example, when you might have a dynamic data structure with pointers.

Definition at line 190 of file p99_new.h.

P99_MALLOC
#define P99_MALLOC(X)
A type oriented malloc wrapper.
Definition: p99_new.h:190