[PATCH] D12669: [libcxxabi] Fix alignment of pointers returned by fallback_malloc

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 09:37:32 PDT 2015


compnerd added a comment.

While I think that ensuring that the fallback malloc path works properly is needed, AIUI, this is still insufficient, as there is a first attempt at using malloc, which doesn't have alignment guarantees (except on Darwin).  Also, a clang-format over the patch would be appreciated.


================
Comment at: src/fallback_malloc.ipp:25
@@ -15,1 +24,3 @@
+#error The required macro '_ALIGNAS_TYPE' is not defined.
+#endif
 
----------------
Ick, but I see why this is needed.  Might be nice to expand the comment about not being able to include headers with a why.

================
Comment at: src/fallback_malloc.ipp:69
@@ -59,1 +68,3 @@
+// Size: 4
+// Alignment: 2
 struct heap_node {
----------------
Make this a set of static_asserts?

================
Comment at: src/fallback_malloc.ipp:104
@@ +103,3 @@
+
+bool is_fallback_ptr(void *ptr) {
+  return ptr >= heap && ptr < (heap + HeapSize);
----------------
Why the movement here?


http://reviews.llvm.org/D12669





More information about the cfe-commits mailing list