private void prepareAbandonUnfinishedMoveAttempt(DiscardContext ctx, int count) {
      if (count == 0) return; // Nothing to do.
      int startIx = ctx.victimCount, start;
      if (ctx.abandonedHeaders == null) {
        start = 0;
        ctx.abandonedHeaders = new int[count];
      } else {
        start = ctx.abandonedCount;
        int newLen = start + count;
        if (newLen > ctx.abandonedHeaders.length) {
          ctx.abandonedHeaders = Arrays.copyOf(ctx.abandonedHeaders, newLen);
        }
      }
      System.arraycopy(ctx.victimHeaders, startIx, ctx.abandonedHeaders, start, count);
      ctx.abandonedCount += count;
      ctx.victimCount = startIx;
    }
Saves the victim headers from a failed reserve into a separate array into the context.
See the comment at the call site; this is to prevent deadlocks.
@param startIx the victim count before this reserve was started.
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java