[all-commits] [llvm/llvm-project] 041f35: [Automaton] Make Automaton thread-safe

James Molloy via All-commits all-commits at lists.llvm.org
Tue Nov 5 14:57:53 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 041f35c468088d315bae6c2a71ec901a12cca1b5
      https://github.com/llvm/llvm-project/commit/041f35c468088d315bae6c2a71ec901a12cca1b5
  Author: James Molloy <James Molloy jmolloy at google.com>
  Date:   2019-11-05 (Tue, 05 Nov 2019)

  Changed paths:
    M llvm/include/llvm/Support/Automaton.h

  Log Message:
  -----------
  [Automaton] Make Automaton thread-safe

In an optimization to improve performance (rL375240) we added a std::shared_ptr
around the main table map. This is safe, but we also ended up making the
transcriber object a std::shared_ptr too. This has mutable state, so must be
copied when we copy the Automaton object. This is very cheap; the main optimization
was about the map `M` only.

Reported by Dan Palermo. No test as triggering this is rather hard from a unit test.




More information about the All-commits mailing list