Function : OS Memory

OSMemAlloc - Allocate a block of memory from the Domino or Notes system.
----------------------------------------------------------------------------------------------------------

#include <osmem.h>

STATUS LNPUBLIC OSMemAlloc(
WORD BlkType,
DWORD dwSize,
DHANDLE far *retHandle);

Description :

OSMemAlloc allocates a block of memory and returns a handle to the caller. The handle can be converted to a memory pointer by calling OSLockObject.

Under normal circumstances, memory allocated using OSMemAlloc must be released using the function OSMemFree. (For the exceptions, please see the discussion under OSMemFree.)

This function is only necessary when allocating memory for which you need a handle to pass to C API functions. If you need to allocate memory that does not require a handle, you can use the standard C function malloc() instead.

Parameters :

Sample Usage :

      /* Allocate a Domino or Notes memory object used in building an ITEM  */
     /* value                                                    */

      if (usError = OSMemAlloc(0, dwTextLen, &ImpTextBID.pool))
          goto Exit;
      else
          wCleanUp |= FREE_IMPTEXTBID;


See Also :

MEM_xxx
----------------------------------------------------------------------------------------------------------