anchor.diff:      procedure PushThreadDeferred(P: Pointer; ReturnAddress: Pointer; IsSmall: Boolean);
       procedure ProcessThreadDeferred;
     public
  -    // most frequently used (assembler optimized)
  +    // most frequently used
       function GetSmall(B16Count: NativeUInt): Pointer;
       function FreeSmall(P: Pointer): Integer;
       function RegrowSmallToSmall(P: Pointer; NewB16Count: NativeUInt): Pointer;
  
positive.code: end;
  
  function TThreadHeap.ReduceMedium(P: Pointer; NewB16Count: NativeUInt): Pointer;
  label
    ptr_invalid, done;
  var
  
negative.code: 
  function TThreadHeap.FreeMedium(P: Pointer): Integer;
  var
    Header: PHeaderMedium;
    Flags, EmptyFlags: NativeUInt;
    Pool: PK64PoolMedium;
  
    StoreHeader:  PHeaderMedium;
  begin
    // header flags
    Header := P;
    Dec(Header);
    Flags := Header.Flags;
  
    // if (Prev.Allocated) and (Next.Empty) then Grow(Next)
    EmptyFlags := Flags and MASK_MEDIUM_ALLOCATED_TEST;
    if (EmptyFlags = MASK_MEDIUM_ALLOCATED_VALUE) then
    begin
      EmptyFlags := PHeaderMedium(NativeUInt(Header) - Header.PreviousSize).Flags;
      EmptyFlags := EmptyFlags and MASK_MEDIUM_ALLOCATED_TEST;
      if (EmptyFlags = MASK_MEDIUM_ALLOCATED_VALUE) then
      begin
        StoreHeader := Header;
        Inc(Header);
        Flags := (Flags shl 4) and ($ffff shl 4);
        Inc(NativeUInt(Header), Flags);
        EmptyFlags := Header.Flags;
        if (EmptyFlags and MASK_MEDIUM_EMPTY_TEST = MASK_MEDIUM_EMPTY_VALUE) and
          (Header.PreviousSize = Flags) then
        begin
          // MediumEmpty.Size := MediumEmpty.Size + Size + 16
          EmptyFlags := EmptyFlags shl 4;
          Inc(Flags, 16);
          Inc(NativeUInt(Header{Empty}), EmptyFlags);
          Inc(Flags, EmptyFlags);
          if (Flags <> SizeOf(THeaderMediumList) - {Start}SizeOf(THeaderMedium)) then
          begin
            PHeaderMediumEmptyEx(Header{Empty}).Size := Flags;
  
            // new empty flags
            Dec(NativeUInt(Header), Flags);
            Flags := Flags shr 4;
            Header.Flags := Flags;
  
            if (StoreHeader <> Header) then
              GLOBAL_STORAGE[0] := 15;
  
            // result
            Result := FREEMEM_DONE;
            Exit;
          end else
          begin
            Pool := PK64PoolMedium(NativeInt(Header) and MASK_K64_CLEAR);
            Result := Pool.ThreadHeap.DisposeK64PoolMedium(Pool);
            Exit;
          end;
        end else
        begin
          Dec(Header);
          Dec(NativeUInt(Header), Flags);
        end;
      end;
    end;
  
    Inc(Header);
    Result := PK64PoolMedium(NativeInt(Header) and MASK_K64_CLEAR).ThreadHeap.PenaltyFreeMedium(Pointer(Header));
  end;
  
  function TThreadHeap.PenaltyFreeMedium(P: Pointer): Integer;
  var
    Information: NativeUInt;
    Pool: PK64PoolMedium;
    Empty, Left, Right: PHeaderMediumEmpty;
  