static final class PageManager.Unix extends PageManager
PageManager.Unix, PageManager.Windows
PROT_EXEC, PROT_READ, PROT_WRITE
Constructor and Description |
---|
Unix() |
Modifier and Type | Method and Description |
---|---|
long |
allocatePages(int npages,
int protection)
Allocates native memory pages.
|
void |
freePages(long address,
int npages)
Free pages allocated via
PageManager.allocatePages(int, int) |
void |
protectPages(long address,
int npages,
int protection)
Sets the protection mask on a memory region.
|
getInstance, pageSize
public long allocatePages(int npages, int protection)
PageManager
PageManager.pageSize
.allocatePages
in class PageManager
npages
- The number of pages to allocate.protection
- The initial protection for the page. This must be a
bitmask of PageManager.PROT_READ
, PageManager.PROT_WRITE
and PageManager.PROT_EXEC
.public void freePages(long address, int npages)
PageManager
PageManager.allocatePages(int, int)
freePages
in class PageManager
address
- The memory address as returned from PageManager.allocatePages(int, int)
npages
- The number of pages to free.public void protectPages(long address, int npages, int protection)
PageManager
protectPages
in class PageManager
address
- The start of the memory region.npages
- The number of pages to protect.protection
- The protection mask.