getcndxmem
Get memory required to process and store conditional index expressions (allows the proper memory allocation routines to be used on the client and server sides).
Declaration
pTEXT getcndxmem( UINT sizobj );
Description
The macros getcndxmem() and putcndxmem(), used to get and put memory required to process and store conditional index expressions, allow the proper memory allocation routines to be used on the client and server sides. (These substitute for the internal mballc() and mbfree() calls.)
Return Values
getcndxmem() returns a pointer to the newly allocated object on success. A NULL pointer is returned if memory could not be allocated.
Example
/* Allocate a run-time stack for the expression analyzer (first time only). */
if (!ctcidxStk) {
ctcidxStk = (pVOID) getcndxmem(CNDX_MAX_STACK * ctSIZE(PLEAF));
if (!ctcidxStk) {
printf("Unable to allocate memory for run-time stack.\n");
ctrt_exit(1);
}
}
if (ctcidxStk)
putcndxmem(ctcidxStk);
See also
cndxeval(), cndxfree(), cndxparse(), ctparsedoda(), cndxrun(), putcndxmem()