[PATCH] D29994: Use pthreads for thread-local lsan allocator cache on darwin

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 13:48:19 PST 2017


fjricci added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_allocator_primary64.h:49-50
  public:
-  static const uptr kSpaceBeg = Params::kSpaceBeg;
-  static const uptr kSpaceSize = Params::kSpaceSize;
+  static const u64 kSpaceBeg = Params::kSpaceBeg;
+  static const u64 kSpaceSize = Params::kSpaceSize;
   static const uptr kMetadataSize = Params::kMetadataSize;
----------------
kubamracek wrote:
> fjricci wrote:
> > kubamracek wrote:
> > > fjricci wrote:
> > > > kubamracek wrote:
> > > > > Why is this necessary?  I mean, the change looks reasonable, but is it related to this change?  If not, please submit it as a separate patch.
> > > > It's necessary, at least on Darwin, because you'll overflow the type if you use a uptr to store a ULL. I'll move it to a separate patch.
> > > This whole class should be ifdef'd to only compile on 64-bit platforms.  Isn't that so?
> > On non-windows platforms, `uptr` is defined as an `unsigned long`, not an `unsigned long long` (sanitizer_internal_defs.h:103)
> Right, and `unsigned long` is 64-bit on (supported) 64-bit platforms, isn't it?
Turns out that `__arm__` was creeping in due to a gap in the if condition. I'll fix that.


https://reviews.llvm.org/D29994





More information about the llvm-commits mailing list