[PATCH] D17815: [libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of dynamic memory exhaustion.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 14:01:35 PDT 2016


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

LGTM after addressing the inline comments.


================
Comment at: src/fallback_malloc.cpp:58
@@ +57,3 @@
+
+#define HEAP_SIZE   512
+char heap [ HEAP_SIZE ];
----------------
A static const variable would be better here.

================
Comment at: src/fallback_malloc.cpp:59
@@ +58,3 @@
+#define HEAP_SIZE   512
+char heap [ HEAP_SIZE ];
+
----------------
This should have `__attribute__((aligned))` on it.

================
Comment at: src/fallback_malloc.h:20
@@ +19,3 @@
+// Allocate some memory from _somewhere_
+void * __cxa_malloc_with_fallback(size_t size);
+
----------------
Please don't use the `__cxa` prefix on these functions. It makes it seem like they are part of the Itanium spec but they're really internal details.


https://reviews.llvm.org/D17815





More information about the cfe-commits mailing list