Class PageManager.Windows
java.lang.Object
com.kenai.jffi.PageManager
com.kenai.jffi.PageManager.Windows
- Enclosing class:
PageManager
-
Nested Class Summary
Nested classes/interfaces inherited from class PageManager
PageManager.Unix, PageManager.Windows -
Field Summary
Fields inherited from class PageManager
PROT_EXEC, PROT_READ, PROT_WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongallocatePages(int pageCount, int protection) Allocates native memory pages.voidfreePages(long address, int pageCount) Free pages allocated viaPageManager.allocatePages(int, int)voidprotectPages(long address, int pageCount, int protection) Sets the protection mask on a memory region.private static intw32prot(int p) Methods inherited from class PageManager
getInstance, pageSize
-
Constructor Details
-
Windows
public Windows()
-
-
Method Details
-
allocatePages
public long allocatePages(int pageCount, int protection) Description copied from class:PageManagerAllocates native memory pages. The memory allocated is aligned on a page boundary, and the size of the allocated memory isnpages*PageManager.pageSize.- Specified by:
allocatePagesin classPageManager- Parameters:
pageCount- The number of pages to allocate.protection- The initial protection for the page. This must be a bitmask ofPageManager.PROT_READ,PageManager.PROT_WRITEandPageManager.PROT_EXEC.- Returns:
- The native address of the allocated memory.
-
freePages
public void freePages(long address, int pageCount) Description copied from class:PageManagerFree pages allocated viaPageManager.allocatePages(int, int)- Specified by:
freePagesin classPageManager- Parameters:
address- The memory address as returned fromPageManager.allocatePages(int, int)pageCount- The number of pages to free.
-
protectPages
public void protectPages(long address, int pageCount, int protection) Description copied from class:PageManagerSets the protection mask on a memory region.- Specified by:
protectPagesin classPageManager- Parameters:
address- The start of the memory region.pageCount- The number of pages to protect.protection- The protection mask.
-
w32prot
private static int w32prot(int p)
-