next up previous contents index
Next: Time Up: Utility Routines Previous: Utility Routines

Storage

 

xMalloc

Essentially the same as the Unix malloc routine. Causes an x-kernel abort if no storage is available; therefore, it has no error return value.

char *xMalloc(int size)

The x-kernel provides a macro, X_NEW, that can be used to allocate space of a certain type.

#define X_NEW(type) (type *)xMalloc(sizeof(type))

xFree

Frees previously allocated memory.

int xFree(char *buf)



Larry Peterson
Tue Jul 1 14:50:34 MST 1997