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

Igor Kudrin via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 08:10:13 PDT 2016


ikudrin updated this revision to Diff 54189.
ikudrin added a comment.

- Moved the content of `fallback_malloc.ipp` into `falback_malloc.cpp`.
- Removed `fallback_malloc.ipp`.
- Added `pragma GCC visibility push(hidden)` for the function's definitions.
- Added a check that the overwritten `calloc` is called to the test.
- Added a loop to run the test several times.

Please note that `test_fallback_malloc.pass.cpp` now has to #include `fallback_malloc.cpp`, because `fallback_malloc.ipp` was removed. I'd considered some other options, including declaring additional functions especially for testing purpose and even moving all fallback_malloc functionality into a separate class which could be tested independently. However, eventually, I found them more difficult and even much worse than the presented approach.


http://reviews.llvm.org/D17815

Files:
  src/CMakeLists.txt
  src/cxa_exception.cpp
  src/cxa_exception_storage.cpp
  src/fallback_malloc.cpp
  src/fallback_malloc.h
  src/fallback_malloc.ipp
  test/test_exception_storage_nodynmem.pass.cpp
  test/test_fallback_malloc.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17815.54189.patch
Type: text/x-patch
Size: 21322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160419/ddcf5c48/attachment-0001.bin>


More information about the cfe-commits mailing list