[PATCH] D25417: [libcxxabi] Fix alignment of allocated exceptions in 32 bit builds

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 5 10:16:28 PST 2016


compnerd accepted this revision.
compnerd added a comment.
This revision is now accepted and ready to land.

I thought we had gotten this merged already.  Oops.  LGTM with the minor tweak for windows.



================
Comment at: src/fallback_malloc.cpp:206
+    return fallback_malloc(size);
 }
 
----------------
Given that libc++abi has some Windows support and usage (e.g. MinGW), we should change this to:

    void *dest;
    #if defined(_WIN32)
      if ((dest = _aligned_malloc(size, alignof(__aligned_type)) == nullptr)
        return fallback_malloc(size);
      return dest;
    #else
      if (::posix_memalign(&dest, alignof(__aligned_type), size) == 0)
        return dest;
      return fallback_malloc(size);
    #endif


https://reviews.llvm.org/D25417





More information about the cfe-commits mailing list