[PATCH] D32500: Optimize ItaniumDemangle by using an arena allocator

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 13:07:06 PDT 2017


davide added a comment.

I have some concerns about the approach. Some of the code is non-portable, I guess, but that can be fixed.
You might want to try reducing the amount of memory allocated rather than growing an homemade allocator to amortize `malloc()/free()` cost. I'm not positive this can be reached with the current design, but there have been several discussions in the past about a full rewrite. (Please note that the demangler has deeper issues, including looking at its own output which has been cause many bugs).



================
Comment at: lib/Demangle/ItaniumDemangle.cpp:49-50
+
+static __thread arena * thread_arena = nullptr;
+
+class arena {
----------------
I'm not sure this will work with MSVC.


Repository:
  rL LLVM

https://reviews.llvm.org/D32500





More information about the llvm-commits mailing list