OSDN Git Service

Add missing ChangeLog entry.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / testsuite_allocator.h
index 7c35344..7be830e 100644 (file)
 #define _GLIBCXX_TESTSUITE_ALLOCATOR_H
 
 #include <cstddef>
-#include <cstdlib>
 #include <limits>
 
 namespace 
 {
-  bool         new_called = false;
-  bool         delete_called = false;
-  std::size_t  requested = 0;
+  bool new_called = false;
+  bool delete_called = false;
 };
 
 namespace __gnu_test
@@ -181,19 +179,24 @@ namespace __gnu_test
   bool
   check_construct_destroy(const char* tag, int expected_c, int expected_d);
 
-  template<typename Alloc, bool uses_global_new_and_delete>
+  template<typename Alloc, bool uses_global_new>
     bool 
     check_new(Alloc a = Alloc())
     {
       bool test __attribute__((unused)) = true;
       typename Alloc::pointer p = a.allocate(10);
-      if (uses_global_new_and_delete)  
-       test &= ( requested >= (10 * 15 * sizeof(long)) );
-      
-      test &= ( new_called == uses_global_new_and_delete );
+      test &= ( new_called == uses_global_new );
+      return test;
+    }
+
+  template<typename Alloc, bool uses_global_delete>
+    bool 
+    check_delete(Alloc a = Alloc())
+    {
+      bool test __attribute__((unused)) = true;
+      typename Alloc::pointer p = a.allocate(10);
       a.deallocate(p, 10);
-      test &= ( delete_called == uses_global_new_and_delete );
-      
+      test &= ( delete_called == uses_global_delete );
       return test;
     }