[PATCH] D31947: [scudo] Android support groundwork

Evgeniy Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 14:19:09 PDT 2017


eugenis added inline comments.


================
Comment at: lib/scudo/scudo_allocator.cpp:317
+                 bool ForceZeroContents = false) {
+    initThreadMaybe();
+    if (UNLIKELY(!IsPowerOfTwo(Alignment))) {
----------------
cryptoad wrote:
> eugenis wrote:
> > Calling initThreadMaybe() from all entry points looks error-prone. Is it ok (performance-wise) to do lazy initialization in getCurrentThreadContext?
> Things like BackendAllocator.ReturnNullOrDieOnBadRequest will require initialization, but are called prior to getCurrentThreadContext.
> I am also actually not super happy about the way this turned out. The alternative would be a preinit or equivalent?
Ideally access to the allocator cache should go through ThreadLocalContext as well. Maybe.

What do you mean by preinit?


https://reviews.llvm.org/D31947





More information about the llvm-commits mailing list