|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.utility.gcspy.Subspace
public class Subspace
This class is an abstraction of a contiguous region of a Space. For example, a semispace collector might choose to model the heap as a single Space, but within that Space it could model each semispace by a Subspace.
Subspace provides a number of useful facilities to many drivers, and is useful even if the Space comprises just a single contiguous region.
A subspace keeps track of the start and end address of the region, the index of its first block, the size of the blocks in this space, and the number of blocks in this subspace.
Field Summary | |
---|---|
private int |
blockNum_
the number of blocks in this space |
private int |
blockSize_
the block size |
private static boolean |
DEBUG
|
private Address |
end_
end address of the subspace. |
private int |
firstIndex_
The index of the block in which start_ lies |
private Address |
start_
start address of the subspace. |
Constructor Summary | |
---|---|
Subspace(Address start,
Address end,
int firstIndex,
int blockSize,
int blockNum)
Create a new subspace |
Method Summary | |
---|---|
boolean |
addressInRange(Address addr)
Is address in the range of this subspace? |
private void |
dump()
Dump a representation of the subspace |
Address |
getAddress(int index)
Get the address of start of block from its index |
int |
getBlockNum()
Get the number of tiles in this subspace |
int |
getBlockSize()
Get the blocksize for this subspace |
Address |
getEnd()
Get the end of this subspace |
int |
getFirstIndex()
Get the first index of subspace |
int |
getIndex(Address addr)
Get the block index from an address |
Address |
getStart()
Get the start of the subspace |
boolean |
indexInRange(int index)
Is an index in the range of this subspace? |
void |
reset(Address start,
Address end,
int blockNum)
Reset a new subspace. |
void |
reset(Address start,
Address end,
int firstIndex,
int blockNum)
Reset a new subspace |
private void |
reset(Address start,
Address end,
int firstIndex,
int blockSize,
int blockNum)
Reset a subspace. |
void |
reset(int firstIndex,
int blockNum)
Reset a new subspace. |
int |
spaceRemaining(Address addr)
Calculate the space remaining in a block after this address |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Address start_
[start_, end_)
private Address end_
[start_, end_)
private int firstIndex_
start_
lies
private int blockSize_
private int blockNum_
private static final boolean DEBUG
Constructor Detail |
---|
public Subspace(Address start, Address end, int firstIndex, int blockSize, int blockNum)
start
- The address of the start of the subspaceend
- The address of the end of the subspacefirstIndex
- The index of the first block of the subspaceblockSize
- The size of blocks in this spaceblockNum
- The number of blocks in this subspaceMethod Detail |
---|
private void reset(Address start, Address end, int firstIndex, int blockSize, int blockNum)
start
- The address of the start of the subspaceend
- The address of the end of the subspacefirstIndex
- The index of the first block of the subspaceblockSize
- The size of blocks in this subspaceblockNum
- The number of blocks in this subspacepublic void reset(Address start, Address end, int firstIndex, int blockNum)
start
- The address of the start of the subspaceend
- The address of the end of the subspacefirstIndex
- The index of the first block of the subspaceblockNum
- The number of blocks in this subspacepublic void reset(Address start, Address end, int blockNum)
start
- The address of the start of the subspaceend
- The address of the end of the subspaceblockNum
- The number of blocks in this subspacepublic void reset(int firstIndex, int blockNum)
firstIndex
- The index of the first block of the subspaceblockNum
- The number of blocks in this subspacepublic boolean indexInRange(int index)
index
- The index of the block
true
if this block lies in this subspacepublic boolean addressInRange(Address addr)
addr
- An address
true
if this address is in a block in this subspacepublic int getIndex(Address addr)
addr
- The address
public Address getAddress(int index)
index
- The index of the block
public Address getStart()
public Address getEnd()
public int getFirstIndex()
public int getBlockSize()
public int getBlockNum()
public int spaceRemaining(Address addr)
addr
- the Address
private void dump()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |