[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
_xalloc()
Allocate memory and return NULL if unsuccessful
------------------------------------------------------------------------------
C Prototype
#include "Extend.h"
void far *_xalloc(unsigned int size)
Arguments
size is the number of bytes to allocate.
Returns
_xalloc() returns a far pointer to the allocated memory or NULL if the
requested memory could not be allocated.
Description
_xalloc() allows a C or Assembly language function to allocate memory
from Clipper's fixed heap. If the allocation request is unsuccessful,
a NULL pointer is returned.
Memory allocated with _xalloc() must be freed after use with _xfree().
Examples
From C:
char *mem;
mem = _xalloc(32);
From Assembly language:
EXTRN __xalloc:FAR
mov ax, 32
push ax
call __xalloc ; pointer in DX:AX
add sp, 2 ; reset stack pointer
Files: Library is CLIPPER.LIB, header file is Extend.h.
See Also:
_xfree()
_xgrab()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson