NXPageAlloc

Allocates memory in pages.

Library:LibC
Classification:NKS
Service:Memory Management

Syntax

  #include <nks/memory.h>
   
  void *NXPageAlloc (
     size_t          pageCount, 
     unsigned long   flags);
  

Parameters

pageCount

Specifies the number of memory pages to allocate.

flags

Specifies the initial state of the pages and uses the following flags:

Flag

Value

Description

NX_MEM_RESERVE

0x00000100

Reserves the specified set of pages.

NX_MEM_LOCK

0x00000001

Locks the specified set of pages. Must be ORed with the NX_MEM_COMMIT flag.

NX_MEM_COMMIT

0x00000040

Return Values

If successful, returns a pointer to the allocated memory; otherwise returns NULL.

Remarks

For sample code, see Memory.c.

See Also