Package com.kenai.jffi
Class PageManager.Unix
- java.lang.Object
-
- com.kenai.jffi.PageManager
-
- com.kenai.jffi.PageManager.Unix
-
- Enclosing class:
- PageManager
static final class PageManager.Unix 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 Unix()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longallocatePages(int npages, int protection)Allocates native memory pages.voidfreePages(long address, int npages)Free pages allocated viaPageManager.allocatePages(int, int)voidprotectPages(long address, int npages, int protection)Sets the protection mask on a memory region.-
Methods inherited from class com.kenai.jffi.PageManager
getInstance, pageSize
-
-
-
-
Method Detail
-
allocatePages
public long allocatePages(int npages, 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:
npages- 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 npages)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)npages- The number of pages to free.
-
protectPages
public void protectPages(long address, int npages, 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.npages- The number of pages to protect.protection- The protection mask.
-
-