ESMAlloc

Allocates memory from extended memory above 4 GB.

Library:LibC
Classification:NetWare OS
Service:NetWare Platform

Syntax

  #include <esm.h> 
   
  int ESMAlloc (
     size64_t        size,
     unsigned long   options,
     addr64_t       *esmAddress);
  

Parameters

size

(IN) Specifies, in bytes, the size of the memory block. The size is rounded up to the next multiple of 4 MB (4194304).

options

(IN) Not currently used.

esmAddress

(OUT) Points to the 64-bit extended address for the allocated memory.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code.

Decimal

Name

Description

1

ERR_ESM_AVAL

The server has no registered memory above 4 GB.

2

ERR_SIZE_ZERO

The size requested is zero.

3

ERR_TABLE_FULL

There is insufficient memory to expand the allocated memory table.

4

ERR_NOT_CONTIGUOUS

The requested amount of memory is not available as contiguous memory.

For other possible values, see Section 30.3, Return Values for ESM Functions.

Remarks

Extended server memory is handled in 4 MB blocks for efficiency. Memory allocated with this interface is not virtual memory and will not be swapped to disk storage.

All memory allocated must be returned to the system when your NLM exits or the resources are lost.

See Also