[PATCH] [Sanitizer RT] Put the module name string ownership in Symbolizer in order

Alexey Samsonov vonosmas at gmail.com
Mon Mar 30 14:42:57 PDT 2015


I'm OK with the change, but have a suggestion. Feel free to address it if you find it reasonable.


================
Comment at: sanitizer_symbolizer.h:125
@@ +124,3 @@
+    ModuleNameOwner() : storage_(kInitialCapacity), last_match_(nullptr) {}
+    const char *GetOwnedCopy(const char *str);
+
----------------
Suggestion: replace the `ModuleNameOwner` class with just a private method of `Symbolizer` class. Then you could self-documented code there:
  mu_.CheckLocked();
and probably hide `last_match_` in the implementation by making a function-static variable storing the cached const char *. It will be thread-safe (protected by mu_), and in practice we don't have many Symbolizer objects anyway.

http://reviews.llvm.org/D8666

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list