docs: static HeapAlphaSketch heapifyInstance(final Memory srcMem, final long seed) {
      final int preambleLongs = extractPreLongs(srcMem);            //byte 0
      final int lgNomLongs = extractLgNomLongs(srcMem);             //byte 3
      final int lgArrLongs = extractLgArrLongs(srcMem);             //byte 4
  
      checkAlphaFamily(srcMem, preambleLongs, lgNomLongs);
      checkMemIntegrity(srcMem, seed, preambleLongs, lgNomLongs, lgArrLongs);
  
      final float p = extractP(srcMem);                             //bytes 12-15
      final int lgRF = extractLgResizeFactor(srcMem);               //byte 0
      final ResizeFactor myRF = ResizeFactor.getRF(lgRF);
  
      final double nomLongs = (1L << lgNomLongs);
      final double alpha = nomLongs / (nomLongs + 1.0);
      final long split1 = (long) (((p * (alpha + 1.0)) / 2.0) * MAX_THETA_LONG_AS_DOUBLE);
  
      if ((myRF == ResizeFactor.X1)
              && (lgArrLongs != Util.startingSubMultiple(lgNomLongs + 1, myRF, MIN_LG_ARR_LONGS))) {
        throw new SketchesArgumentException("Possible corruption: ResizeFactor X1, but provided "
                + "array too small for sketch size");
      }
  
      final HeapAlphaSketch has = new HeapAlphaSketch(lgNomLongs, seed, p, myRF, alpha, split1);
      has.lgArrLongs_ = lgArrLongs;
      has.hashTableThreshold_ = setHashTableThreshold(lgNomLongs, lgArrLongs);
      has.curCount_ = extractCurCount(srcMem);
      has.thetaLong_ = extractThetaLong(srcMem);
      has.empty_ = PreambleUtil.isEmpty(srcMem);
      has.cache_ = new long[1 << lgArrLongs];
      srcMem.getLongArray(preambleLongs << 3, has.cache_, 0, 1 << lgArrLongs); //read in as hash table
      return has;
    }