anchor.diff:  
    if assigned(BestSubMatches) then begin
     if assigned(Matched) then begin
  -   ThreadLocalState.SubMatchesRelease(Matched);
  +   ThreadLocalStorage.SubMatchesRelease(Matched);
     end;
     Matched:=BestSubMatches;
    end;
  
positive.code: begin
   result:=false;
  
   Input:=ThreadLocalState.Input;
   InputLength:=ThreadLocalState.InputLength;
  
   CurrentThreadList:=@ThreadLocalState.ThreadLists[0];
   NewThreadList:=@ThreadLocalState.ThreadLists[1];
  
   CurrentThreadList^.Count:=0;
   NewThreadList^.Count:=0;
  
   SubMatches:=ThreadLocalState.SubMatchesAllocate(CountSubMatches,0);
  
   inc(ThreadLocalState.Generation);
   if UnanchoredStart then begin
    ThreadLocalState.AddThread(ThreadLocalState,CurrentThreadList,UnanchoredStartInstruction,SubMatches,StartPosition);
   end else begin
    ThreadLocalState.AddThread(ThreadLocalState,CurrentThreadList,AnchoredStartInstruction,SubMatches,StartPosition);
   end;
  
   Matched:=nil;
  
negative.code:  end;
  end;
  
  procedure TFLREThreadLocalStorage.DFAFreeUsedStatePool;
  var Pool,NextPool:PFLREDFAStatePool;
      State:PFLREDFAState;
  begin
  