| Modifier and Type | Field and Description |
|---|---|
| private LongHashMap | |
| private boolean | |
| private PageFetcher | |
| private Page | |
| private long | |
| private long | |
| private long | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | PageCache(long pageSize, long maxNumPages, PageFetcher fetcher)
The pageSize must be a power of two and implicitly specifies the alignment of pages. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private Page | |
| private void | checkPageInfo(long pageSize, long maxNumPages)
Ensure that page size fits within 32 bits and is a power of two, and that maxNumPages > 0 |
| public synchronized void | clear(long startAddress, long numBytes)
A mechanism for clearing cached data covering the given region |
| public synchronized void | |
| private int | |
| public synchronized void | disable()
Disables the page cache; no further pages will be added to the cache and all existing pages will be flushed. |
| public synchronized void | |
| private void | |
| public synchronized boolean | |
| public synchronized byte | |
| public synchronized char | |
| public synchronized byte[] | getData(long startAddress, long numBytes)
This handles fetches which span multiple pages by virtue of the presence of the PageFetcher. |
| public synchronized double | |
| public synchronized float | |
| public synchronized int | |
| public synchronized long | |
| private Page | |
| public synchronized short | |
| private void |
| addressToPageMap | back to summary |
|---|---|
| private LongHashMap addressToPageMap | |
| enabled | back to summary |
|---|---|
| private boolean enabled | |
| fetcher | back to summary |
|---|---|
| private PageFetcher fetcher | |
| lruList | back to summary |
|---|---|
| private Page lruList | |
| maxNumPages | back to summary |
|---|---|
| private long maxNumPages | |
| numPages | back to summary |
|---|---|
| private long numPages | |
| pageMask | back to summary |
|---|---|
| private long pageMask | |
| pageSize | back to summary |
|---|---|
| private long pageSize | |
| PageCache | back to summary |
|---|---|
| public PageCache(long pageSize, long maxNumPages, PageFetcher fetcher) The pageSize must be a power of two and implicitly specifies the alignment of pages. numPages specifies how many pages should be cached. | |
| addPageToList | back to summary |
|---|---|
| private void addPageToList(Page page) | |
| checkPage | back to summary |
|---|---|
| private Page checkPage(Page page, long startAddress) | |
| checkPageInfo | back to summary |
|---|---|
| private void checkPageInfo(long pageSize, long maxNumPages) Ensure that page size fits within 32 bits and is a power of two, and that maxNumPages > 0 | |
| clear | back to summary |
|---|---|
| public synchronized void clear(long startAddress, long numBytes) A mechanism for clearing cached data covering the given region | |
| clear | back to summary |
|---|---|
| public synchronized void clear() A mechanism for clearing out the cache is necessary to handle detaching and reattaching | |
| countPages | back to summary |
|---|---|
| private int countPages() | |
| disable | back to summary |
|---|---|
| public synchronized void disable() Disables the page cache; no further pages will be added to the cache and all existing pages will be flushed. Call this when the target process has been resumed. | |
| enable | back to summary |
|---|---|
| public synchronized void enable() Enables the page cache; fetched pages will be added to the cache. Call this when the target process has been suspended. | |
| flushPage | back to summary |
|---|---|
| private void flushPage(long pageBaseAddress) | |
| getBoolean | back to summary |
|---|---|
| public synchronized boolean getBoolean(long address) | |
| getByte | back to summary |
|---|---|
| public synchronized byte getByte(long address) | |
| getChar | back to summary |
|---|---|
| public synchronized char getChar(long address, boolean bigEndian) | |
| getData | back to summary |
|---|---|
| public synchronized byte[] getData(long startAddress, long numBytes) throws UnmappedAddressException This handles fetches which span multiple pages by virtue of the presence of the PageFetcher. Throws UnmappedAddressException if a page on which data was requested was unmapped. This can not really handle numBytes > 32 bits. | |
| getDouble | back to summary |
|---|---|
| public synchronized double getDouble(long address, boolean bigEndian) | |
| getFloat | back to summary |
|---|---|
| public synchronized float getFloat(long address, boolean bigEndian) | |
| getInt | back to summary |
|---|---|
| public synchronized int getInt(long address, boolean bigEndian) | |
| getLong | back to summary |
|---|---|
| public synchronized long getLong(long address, boolean bigEndian) | |
| getPage | back to summary |
|---|---|
| private Page getPage(long pageBaseAddress) Page fetcher plus LRU functionality | |
| getShort | back to summary |
|---|---|
| public synchronized short getShort(long address, boolean bigEndian) | |
| removePageFromList | back to summary |
|---|---|
| private void removePageFromList(Page page) | |