c++config (__USE_MALLOC): Report case where the user improperly defined it on the...
authorLoren J. Rittle <ljrittle@acm.org>
Wed, 15 May 2002 22:32:25 +0000 (22:32 +0000)
committerLoren J. Rittle <ljrittle@gcc.gnu.org>
Wed, 15 May 2002 22:32:25 +0000 (22:32 +0000)
libstdc++/6641
* include/bits/c++config (__USE_MALLOC): Report case where
the user improperly defined it on the command line.

From-SVN: r53494

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/c++config

index 91082c7ebf2a9450d717362af36b241342b8e869..d94791b86b282548a4b562d610f1d50ae950916d 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-15  Loren J. Rittle <ljrittle@acm.org>
+
+       libstdc++/6641
+       * include/bits/c++config (__USE_MALLOC): Report case where
+       the user improperly defined it on the command line.
+
 2002-05-15  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        * testsuite/testsuite_hooks.h (__set_testsuite_memlimit):
index b3e1916a222b1f8a76b718bd6d081ee775754137..3433f02bc9b2b40cb0bc2da6552904c7cab5af4d 100644 (file)
 // that threads are properly configured on your platform before
 // assigning blame to the STL container-memory allocator.  After doing
 // so, please report any possible issues to libstdc++@gcc.gnu.org .
-// Do not blindly #define __USE_MALLOC here or on the command line.
+// Do not define __USE_MALLOC on the command line.  Enforce it here:
+#ifdef __USE_MALLOC
+#error __USE_MALLOC should only be defined within \
+libstdc++-v3/include/bits/c++config before full recompilation of the library.
+#endif
+// Define __USE_MALLOC after this point in the file in order to aid debugging
+// or globally change allocation policy.  This breaks the ABI, thus
+// completely recompile the library.  A patch to better support
+// changing the global allocator policy would be probably be accepted.
 
 // The remainder of the prewritten config is mostly automatic; all the
 // user hooks are listed above.