Module openj9.dtfj

Class J9MemTagHelper

java.lang.Object
com.ibm.j9ddr.vm29.pointer.helper.J9MemTagHelper

public class J9MemTagHelper extends Object
  • Field Details

    • ROUNDING_GRANULARITY

      public static final long ROUNDING_GRANULARITY
      See Also:
    • J9PORT_MEMTAG_HEADER_TAG_CORRUPTED

      public static IDATA J9PORT_MEMTAG_HEADER_TAG_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
  • Constructor Details

    • J9MemTagHelper

      public J9MemTagHelper()
  • Method Details

    • 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_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