docs: static boolean checkIsCompactMemory(final Memory srcMem) {
      // only reading so downcast is ok
      final int flags = extractFlags(srcMem);
      final int compactFlags = READ_ONLY_FLAG_MASK | COMPACT_FLAG_MASK;
      return (flags & compactFlags) > 0;
    }