anchor.diff: -{ڴ}
  -
  -//// :QQ:75492895()
  -////   лṩڴأڽҵݵڴ.
  -//// 滻ԭuBufferԪ
  +(*
  + *	 Unit owner: , d10.
  + *	       blog: http://www.cnblogs.com/dksoft
  + *     homePage: www.diocp.org
  + *
  + *
  + *1. 2015717 15:01:12
  + *    TBufferLinkӺ
  + *     /// <summary>
  + *    ///  ӵǰλÿʼBuffer
  + *    ///   subBufʼλ
  + *    ///   -1
  + *    /// </summary>
  + *    function SearchBuffer(subBuf:PAnsiChar; subBufLen:Cardinal): Integer;
  + *
  + *)
   
   unit utils.buffer;
   
   /// 2014226 11:33:38
   ///  ï
   ///  inline
  -{$IF defined(FPC) or defined(VER170) or defined(VER180) or defined(VER190) or defined(VER200) or defined(VER210)}
  +//{$IF defined(FPC) or defined(VER170) or defined(VER180) or defined(VER190) or defined(VER200) or defined(VER210)}
  +//  {$DEFINE HAVE_INLINE}
  +//{$IFEND}
  +
  +{$if CompilerVersion > 18}
     {$DEFINE HAVE_INLINE}
  -{$IFEND}
  -
  +{$ifend}
   interface
   
   uses
  
positive.code:   LargeMPool: TDxMemoryPool = nil;
    SPLargeMPool: TDxMemoryPool = nil;
    MaxMPool: TDxMemoryPool = nil;
  
  
  function CalcMemType(MemSize: Integer): TDxMemBlockType;
  
negative.code: begin
    FMark := FRead;
    FMarkPosition := FReadPosition;
  end;
  
  function TBufferLink.SearchBuffer(subBuf:PAnsiChar; subBufLen:Cardinal):
      Integer;
  var
    lvBufBlock: PMemoryBlock;
  
    lvPRes:Pointer;
  
    l, x, lvPosition:Cardinal;
  begin
    Result := -1;
    l := 0;
  
    lvBufBlock := FRead;
    lvPosition := FReadPosition;
  
    if lvBufBlock = nil then
    begin   // ͷʼ
      lvBufBlock := FHead;
      lvPosition := 0;
    end;
  
    if lvBufBlock <> nil then
    begin
      while lvBufBlock <> nil do
      begin
        lvPRes := SearchPointer(lvBufBlock.Memory, lvBufBlock.DataLen, lvPosition, subBuf, subBufLen);
        if lvPRes <> nil then
        begin
          x := PAnsiChar(lvPRes) - PAnsiChar(lvBufBlock.Memory) - lvPosition;
          Result := l + x;
          Break;
        end else
        begin
          l := l + lvBufBlock.DataLen - lvPosition;
  
          // һ
          lvBufBlock := lvBufBlock.NextEx;
          lvPosition := 0;
        end;
      end;
    end;
  end;
  
  function TBufferLink.validCount: Integer;
  