Package com.kenai.jffi
Class PageManager.Windows
- java.lang.Object
-
- com.kenai.jffi.PageManager
-
- com.kenai.jffi.PageManager.Windows
-
- Enclosing class:
- PageManager
static final class PageManager.Windows extends 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 Constructor Description Windows()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longallocatePages(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 com.kenai.jffi.PageManager
getInstance, pageSize
-
-
-
-
Method Detail
-
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)
-
-