- java.lang.Object
-
- com.ibm.j9ddr.vm29.pointer.helper.J9MemTagHelper
-
public class J9MemTagHelper extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
J9MemTagHelper.J9MemTagCheckError
-
Field Summary
Fields Modifier and Type Field Description static IDATA
J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED
static IDATA
J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED
static IDATA
J9PORT_MEMTAG_HEADER_TAG_CORRUPTED
static IDATA
J9PORT_MEMTAG_NOT_A_TAG
static IDATA
J9PORT_MEMTAG_VALID_TAG
static long
ROUNDING_GRANULARITY
-
Constructor Summary
Constructors Constructor Description J9MemTagHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkPadding(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerTagAddress)
Checks that the padding associated with the memory block has not been corruptedstatic void
checkTagSumCheck(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer tag, long eyeCatcher)
Checks that the memory tag is not corrupt.static IDATA
j9mem_check_tags(VoidPointer memoryPointer, long headerEyecatcher, long footerEyecatcher)
Performs validation checks on the memory block starting at memoryPointer.static VoidPointer
j9mem_get_footer_padding(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress)
Given the address of the headerEyecatcher for the memory block, return the address of the footer padding.static com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer
j9mem_get_footer_tag(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress)
Given the address of the headerEyecatcher for the memory block, return the address of the corresponding footer tag.static com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer
j9mem_get_header_tag(VoidPointer memoryPointer)
Given the address returned by @ref j9mem_allocate_memory(), return address of the header tag for the memory blockstatic VoidPointer
j9mem_get_memory_base(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress)
Given the address of the headerEyecatcher for the memory block, return the memory pointer that was returned by j9mem_allocate_memory() when the block was allocated.static UDATA
ROUNDED_FOOTER_OFFSET(UDATA number)
-
-
-
Field Detail
-
ROUNDING_GRANULARITY
public static final long ROUNDING_GRANULARITY
- See Also:
- Constant Field Values
-
J9PORT_MEMTAG_HEADER_TAG_CORRUPTED
public static IDATA J9PORT_MEMTAG_HEADER_TAG_CORRUPTED
-
J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED
public static IDATA J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED
-
J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED
public static IDATA J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED
-
J9PORT_MEMTAG_NOT_A_TAG
public static IDATA J9PORT_MEMTAG_NOT_A_TAG
-
J9PORT_MEMTAG_VALID_TAG
public static IDATA J9PORT_MEMTAG_VALID_TAG
-
-
Method Detail
-
j9mem_check_tags
public static IDATA j9mem_check_tags(VoidPointer memoryPointer, long headerEyecatcher, long footerEyecatcher) throws J9MemTagHelper.J9MemTagCheckError
Performs validation checks on the memory block starting at memoryPointer. The memory passed in could fall into one of three categories: 1) It could be a valid J9MemTag region with valid headers and footers 2) It could be not be a J9MemTag region 3) It could be a J9MemTag region with some corruption in either the header, footer or padding- Returns:
- J9PORT_MEMTAG_NOT_A_TAG if memoryPointer address is not a tag J9PORT_MEMTAG_HEADER_TAG_CORRUPTED if memoryPointer address is valid tag region but header tag is corrupted. J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED if memoryPointer address is valid tag region but footer tag is corrupted. J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED if memoryPointer address is valid tag region but footer padding is corrupted. J9PORT_MEMTAG_VALID_TAG if memoryPointer address is valid tag and header/footer are not corrupted.
- Throws:
CorruptDataException
- if the tags are corrupted, or the memory is inaccessible. (Option 3)J9MemTagHelper.J9MemTagCheckError
-
checkTagSumCheck
public static void checkTagSumCheck(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer tag, long eyeCatcher) throws CorruptDataException
Checks that the memory tag is not corrupt.- Throws:
CorruptDataException
-
j9mem_get_memory_base
public static VoidPointer j9mem_get_memory_base(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress)
Given the address of the headerEyecatcher for the memory block, return the memory pointer that was returned by j9mem_allocate_memory() when the block was allocated.
-
j9mem_get_footer_tag
public static com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer j9mem_get_footer_tag(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress) throws CorruptDataException
Given the address of the headerEyecatcher for the memory block, return the address of the corresponding footer tag.- Throws:
CorruptDataException
-
j9mem_get_header_tag
public static com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer j9mem_get_header_tag(VoidPointer memoryPointer)
Given the address returned by @ref j9mem_allocate_memory(), return address of the header tag for the memory block
-
checkPadding
public static void checkPadding(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerTagAddress) throws CorruptDataException
Checks that the padding associated with the memory block has not been corrupted- Throws:
CorruptDataException
-
j9mem_get_footer_padding
public static VoidPointer j9mem_get_footer_padding(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress) throws CorruptDataException
Given the address of the headerEyecatcher for the memory block, return the address of the footer padding. Note that there not be any padding, in which case this returns the same as @ref j9mem_get_footer_tag(), the address of the footer tag.- Throws:
CorruptDataException
-
-