[cfe-commits] [libcxx] r120914 - in /libcxx/trunk/src: exception.cpp new.cpp

Howard Hinnant hhinnant at apple.com
Sat Dec 4 11:54:11 PST 2010


Author: hhinnant
Date: Sat Dec  4 13:54:11 2010
New Revision: 120914

URL: http://llvm.org/viewvc/llvm-project?rev=120914&view=rev
Log:
Fix up uses of new/terminate/unexpected handlers to use the new getters.

Modified:
    libcxx/trunk/src/exception.cpp
    libcxx/trunk/src/new.cpp

Modified: libcxx/trunk/src/exception.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/exception.cpp?rev=120914&r1=120913&r2=120914&view=diff
==============================================================================
--- libcxx/trunk/src/exception.cpp (original)
+++ libcxx/trunk/src/exception.cpp Sat Dec  4 13:54:11 2010
@@ -38,7 +38,7 @@
 void
 std::unexpected()
 {
-    (*__unexpected_handler)();
+    (*get_unexpected())();
     // unexpected handler should not return
     std::terminate();
 }
@@ -62,7 +62,7 @@
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-        (*__terminate_handler)();
+        (*get_terminate())();
         // handler should not return
         ::abort ();
 #ifndef _LIBCPP_NO_EXCEPTIONS

Modified: libcxx/trunk/src/new.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/new.cpp?rev=120914&r1=120913&r2=120914&view=diff
==============================================================================
--- libcxx/trunk/src/new.cpp (original)
+++ libcxx/trunk/src/new.cpp Sat Dec  4 13:54:11 2010
@@ -36,8 +36,9 @@
     {
         // If malloc fails and there is a new_handler,
         // call it to try free up memory.
-        if (__new_handler)
-            __new_handler();
+        std::new_handler nh = get_new_handler();
+        if (nh)
+            nh();
         else
 #ifndef _LIBCPP_NO_EXCEPTIONS
             throw std::bad_alloc();





More information about the cfe-commits mailing list