static final class PageManager.Windows extends PageManager
PageManager.Unix, PageManager.Windows
PROT_EXEC, PROT_READ, PROT_WRITE
Constructor and Description |
---|
Windows() |
Modifier and Type | Method and Description |
---|---|
long |
allocatePages(int pageCount,
int protection)
Allocates native memory pages.
|
void |
freePages(long address,
int pageCount)
Free pages allocated via
PageManager.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) |
getInstance, pageSize
public long allocatePages(int pageCount, int protection)
PageManager
PageManager.pageSize
.allocatePages
in class PageManager
pageCount
- 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 pageCount)
PageManager
PageManager.allocatePages(int, int)
freePages
in class PageManager
address
- The memory address as returned from PageManager.allocatePages(int, int)
pageCount
- The number of pages to free.public void protectPages(long address, int pageCount, int protection)
PageManager
protectPages
in class PageManager
address
- The start of the memory region.pageCount
- The number of pages to protect.protection
- The protection mask.private static int w32prot(int p)