Package com.kenai.jffi
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 com.kenai.jffi.PageManager
PageManager.Unix, PageManager.Windows
-
Field Summary
Fields inherited from class com.kenai.jffi.PageManager
PROT_EXEC, PROT_READ, PROT_WRITE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
allocatePages
(int pageCount, int protection) Allocates native memory pages.void
freePages
(long address, int pageCount) Free pages allocated viaPageManager.allocatePages(int, int)
void
protectPages
(long address, int pageCount, int protection) Sets the protection mask on a memory region.private static int
w32prot
(int p) Methods inherited from class com.kenai.jffi.PageManager
getInstance, pageSize
-
Constructor Details
-
Windows
public Windows()
-
-
Method Details
-
allocatePages
public long allocatePages(int pageCount, int protection) Description copied from class:PageManager
Allocates native memory pages. The memory allocated is aligned on a page boundary, and the size of the allocated memory isnpages
*PageManager.pageSize
.- Specified by:
allocatePages
in 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_WRITE
andPageManager.PROT_EXEC
.- Returns:
- The native address of the allocated memory.
-
freePages
public void freePages(long address, int pageCount) Description copied from class:PageManager
Free pages allocated viaPageManager.allocatePages(int, int)
- Specified by:
freePages
in 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:PageManager
Sets the protection mask on a memory region.- Specified by:
protectPages
in 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)
-