[GRASS-SVN] r50130 - in grass/trunk: include/iostream lib/iostream

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 10 23:43:05 EST 2012


Author: glynn
Date: 2012-01-10 20:43:05 -0800 (Tue, 10 Jan 2012)
New Revision: 50130

Modified:
   grass/trunk/include/iostream/mm.h
   grass/trunk/lib/iostream/mm.cpp
Log:
Fix exception specifications for new/delete operators


Modified: grass/trunk/include/iostream/mm.h
===================================================================
--- grass/trunk/include/iostream/mm.h	2012-01-10 21:03:21 UTC (rev 50129)
+++ grass/trunk/include/iostream/mm.h	2012-01-11 04:43:05 UTC (rev 50130)
@@ -128,10 +128,10 @@
   void print();
 
   friend class mm_register_init;
-  friend void * operator new(size_t);
-  friend void * operator new[](size_t);
-  friend void operator delete(void *);
-  friend void operator delete[](void *);
+  friend void * operator new(size_t) throw(std::bad_alloc);
+  friend void * operator new[](size_t) throw(std::bad_alloc);
+  friend void operator delete(void *) throw();
+  friend void operator delete[](void *) throw();
 };
 
 

Modified: grass/trunk/lib/iostream/mm.cpp
===================================================================
--- grass/trunk/lib/iostream/mm.cpp	2012-01-10 21:03:21 UTC (rev 50129)
+++ grass/trunk/lib/iostream/mm.cpp	2012-01-11 04:43:05 UTC (rev 50130)
@@ -274,7 +274,7 @@
 
  
 /* ************************************************************ */
-void* operator new[] (size_t sz) {
+void* operator new[] (size_t sz) throw(std::bad_alloc) {
   void *p;
   
   MM_DEBUG cout << "new: sz=" << sz << ", register " 
@@ -325,7 +325,7 @@
 
  
 /* ************************************************************ */
-void* operator new (size_t sz) {
+void* operator new (size_t sz) throw(std::bad_alloc) {
   void *p;
   
   MM_DEBUG cout << "new: sz=" << sz << ", register " 
@@ -377,7 +377,7 @@
 
 
 /* ---------------------------------------------------------------------- */
-void operator delete (void *ptr)  {
+void operator delete (void *ptr) throw() {
   size_t sz;
   void *p;
   
@@ -417,7 +417,7 @@
 
 
 /* ---------------------------------------------------------------------- */
-void operator delete[] (void *ptr) {
+void operator delete[] (void *ptr) throw() {
   size_t sz;
   void *p;
   



More information about the grass-commit mailing list