HeapSegment
public
final
class
HeapSegment
extends Object
| java.lang.Object
|
| ↳ |
com.android.tradefed.device.server.HeapSegment
|
Describes the types and locations of objects in a segment of a heap.
Summary
Nested classes |
class |
HeapSegment.HeapSegmentElement
Describes an object/region encoded in the HPSG data.
|
Public constructors |
HeapSegment(ByteBuffer hpsgData)
Create a new HeapSegment based on the raw contents of an HPSG chunk.
|
Fields
mAllocationUnitCount
protected int mAllocationUnitCount
mAllocationUnitSize
protected int mAllocationUnitSize
mHeapId
protected int mHeapId
mOffset
protected int mOffset
mStartAddress
protected long mStartAddress
mUsageData
protected ByteBuffer mUsageData
Public constructors
HeapSegment
public HeapSegment (ByteBuffer hpsgData)
Create a new HeapSegment based on the raw contents of an HPSG chunk.
| Parameters |
hpsgData |
ByteBuffer: The raw data from an HPSG chunk. |
| Throws |
|
if hpsgData is too small to hold the HPSG chunk header data. |
Public methods
append
public boolean append (HeapSegment other)
Append the contents of other to this segment if it describes the segment
immediately after this one.
| Parameters |
other |
HeapSegment: The segment to append to this segment, if possible. If appended, other
will be invalid when this method returns. |
| Returns |
boolean |
true if other was successfully appended to this segment. |
canAppend
public boolean canAppend (HeapSegment other)
See if other comes immediately after this segment.
| Parameters |
other |
HeapSegment: The HeapSegment to check. |
| Returns |
boolean |
true if other comes immediately after this segment. |
compareTo
public int compareTo (HeapSegment other)
| Parameters |
other |
HeapSegment |
equals
public boolean equals (Object o)
getEndAddress
public long getEndAddress ()
getLength
public int getLength ()
getStartAddress
public long getStartAddress ()
hashCode
public int hashCode ()
isValid
public boolean isValid ()
See if this segment still contains data, and has not been appended to another segment.
| Returns |
boolean |
true if this segment has not been appended to another segment. |
rewindElements
public void rewindElements ()
toString
public String toString ()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-12-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-04 UTC."],[],[]]