anchor.diff:   end;
   end;
   
  -function TFLREDFA.FastProcessNextState(State:PFLREDFAState;const CurrentChar:ansichar;const Reversed:boolean):PFLREDFAState;
  -var Counter:longint;
  -    Instruction:PFLREInstruction;
  -begin
  -
  - // Process state instructions
  - inc(Generation);
  - NewState.CountInstructions:=0;
  - NewState.Flags:=(State^.Flags and sfDFAStart) shl sfDFANeedShift;
  - for Counter:=0 To State^.CountInstructions-1 do begin
  -  Instruction:=State^.Instructions[Counter];
  -  case Instruction^.IDandOpcode and $ff of
  -   opSINGLECHAR:begin
  -    if byte(ansichar(CurrentChar))=Instruction^.Value then begin
  -     FastAddInstructionThread(@NewState,Instruction^.Next);
  -    end;
  -   end;
  -   opCHAR:begin
  -    if CurrentChar in PFLRECharClass(pointer(ptruint(Instruction^.Value)))^ then begin
  -     FastAddInstructionThread(@NewState,Instruction^.Next);
  -    end;
  -   end;
  -   opANY:begin
  -    FastAddInstructionThread(@NewState,Instruction^.Next);
  -   end;
  -   opMATCH:begin
  -    if not (SearchLongest or Reversed) then begin
  -     // We can stop processing the instruction list queue here since we found a match (for the PCRE leftmost first valid match behaviour)
  -     break;
  -    end;
  -   end;
  -   else begin
  -    // Oops?! Invalid byte code instruction for the DFA processing context! So abort and fallback to NFA...
  -    result:=nil;
  -    exit;
  -   end;
  -  end;
  - end;
  -
  - // Dead state? If yes, ...
  - if NewState.CountInstructions=0 then begin
  -  // ... drop it and take the dead state as the next state
  -  result:=DefaultStates[skDead];
  - end else begin
  -  // .. otherwise try caching it
  -  result:=CacheState(@NewState);
  - end;
  -
  - // Connect the last state to the new state with the current char
  - State.NextStates[Instance.ByteMap[byte(ansichar(CurrentChar))]]:=result;
  -
  -end;
  -
   function TFLREDFA.FullProcessNextState(State:PFLREDFAState;const Position:longint;const CurrentChar:longword;const Reversed:boolean):PFLREDFAState;
   var Counter:longint;
       Instruction:PFLREInstruction;
  
positive.code:        WorkQueues:TFLREDFAWorkQueues;
         constructor Create(const AThreadLocalStorageInstance:TFLREThreadLocalStorageInstance);
         destructor Destroy; override;
         function CacheState(const State:PFLREDFAState):PFLREDFAState; {$ifdef caninline}inline;{$endif}
         procedure FastAddInstructionThread(const State:PFLREDFAState;Instruction:PFLREInstruction);
         procedure FullAddInstructionThread(const State:PFLREDFAState;Instruction:PFLREInstruction;const Flags:longword);
         function FastProcessNextState(State:PFLREDFAState;const CurrentChar:ansichar;const Reversed:boolean):PFLREDFAState;
         function FullProcessNextState(State:PFLREDFAState;const Position:longint;const CurrentChar:longword;const Reversed:boolean):PFLREDFAState;
         procedure DestroyStatePool(var StatePool:PFLREDFAStatePool);
         procedure FreeUsedStatePool;
         function AllocateNewStatePool:PFLREDFAStatePool;
  
negative.code: 
  end;
  
  procedure TFLREDFA.DestroyStatePool(var StatePool:PFLREDFAStatePool);
  var Pool,NextPool:PFLREDFAStatePool;
      State:PFLREDFAState;
  begin
   Pool:=StatePool;
   StatePool:=nil;
   while assigned(Pool) do begin
    NextPool:=Pool^.Next;
    State:=Pool^.States;
    while assigned(State) and (State<>Pool^.EndState) do begin
     FreeState(State);
     inc(ptruint(State),StateSize);
    end;
    FreeMem(Pool^.States);
    FreeMem(Pool);
    Pool:=NextPool;
   end;
  end;
  
  procedure TFLREDFA.FreeUsedStatePool;
  var Pool,NextPool:PFLREDFAStatePool;
      State:PFLREDFAState;
  begin
   Pool:=StatePoolUsed;
   StatePoolUsed:=nil;
   while assigned(Pool) do begin
    NextPool:=Pool^.Next;
    State:=Pool^.States;
    while assigned(State) and (State<>Pool^.EndState) do begin
     FreeState(State);
     inc(ptruint(State),StateSize);
    end;
    FillChar(Pool^.States^,StatePoolSize,AnsiChar(#0));
    Pool^.Next:=StatePoolFree;
    StatePoolFree:=Pool;
    Pool:=NextPool;
   end;
  end;
  
  function TFLREDFA.AllocateNewStatePool:PFLREDFAStatePool;
  begin
   if assigned(StatePoolFree) then begin
    result:=StatePoolFree;
    StatePoolFree:=result^.Next;
   end else begin
    GetMem(result,SizeOf(TFLREDFAStatePool));
    FillChar(result^,SizeOf(TFLREDFAStatePool),AnsiChar(#0));
    GetMem(result^.States,StatePoolSizePowerOfTwo);
    FillChar(result^.States^,StatePoolSize,AnsiChar(#0));
    result^.EndState:=pointer(ptruint(ptruint(result^.States)+ptruint(StatePoolSize)));
   end;
   result^.Next:=StatePoolUsed;
   StatePoolUsed:=result;
   result^.NextState:=result^.States;
  end;
  
  function TFLREDFA.GetState:PFLREDFAState;
  begin
   if StatePoolUsed^.NextState=StatePoolUsed^.EndState then begin
    AllocateNewStatePool;
   end;
   result:=StatePoolUsed^.NextState;
   inc(ptruint(StatePoolUsed^.NextState),StateSize);
  end;
  
  function TFLREDFA.TakeOverState(TakeOverFrom:PFLREDFAState):PFLREDFAState;
  begin
   result:=GetState;
   result^.Instructions:=TakeOverFrom^.Instructions;
   result^.CountInstructions:=TakeOverFrom^.CountInstructions;
   result^.Flags:=TakeOverFrom^.Flags;
   TakeOverFrom^.Instructions:=nil;
   TakeOverFrom^.CountInstructions:=0;
   TakeOverFrom^.Flags:=0;
  end;
  
  procedure TFLREDFA.FreeState(State:PFLREDFAState);
  begin
   if assigned(State) then begin
    SetLength(State^.Instructions,0);
    if assigned(StatePoolUsed) and
       ((ptruint(ptruint(State)-ptruint(StatePoolUsed^.States))<StatePoolSize) and
        (pointer(ptruint(ptruint(StatePoolUsed^.NextState)-ptruint(StateSize)))=State)) then begin
     FillChar(State^,StateSize,AnsiChar(#0));
     dec(ptruint(StatePoolUsed^.NextState),StateSize);
    end;
   end;
  end;
  
  procedure TFLREDFA.Reset;
  var Index:longint;
      State:PFLREDFAState;
  begin
  
   // Reset state pools
   FreeUsedStatePool;
   AllocateNewStatePool;
  
   // Reset state cache
   StateCache.Clear;
   CountStatesCached:=0;
  
   // Reset and recaching start states
   for Index:=0 to length(DefaultStates)-1 do begin
    State:=DefaultStates[Index];
    if assigned(State) then begin
     FillChar(State^.NextStates,NextStatesSize,AnsiChar(#0));
     StateCache.Add(State);
     inc(CountStatesCached);
    end;
   end;
  
  end;
  
  
  procedure TFLREDFA.FastAddInstructionThread(const State:PFLREDFAState;Instruction:PFLREInstruction);
  var StackPointer:longint;
      Stack:PPFLREInstructionsStatic;
  