summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support/test_allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/support/test_allocator.h')
-rw-r--r--libcxx/test/support/test_allocator.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/libcxx/test/support/test_allocator.h b/libcxx/test/support/test_allocator.h
index 03bd3905606..47ef1d55678 100644
--- a/libcxx/test/support/test_allocator.h
+++ b/libcxx/test/support/test_allocator.h
@@ -74,10 +74,10 @@ public:
}
++time_to_throw;
++alloc_count;
- return (pointer)std::malloc(n * sizeof(T));
+ return (pointer)::operator new(n * sizeof(T));
}
void deallocate(pointer p, size_type n)
- {assert(data_ >= 0); --alloc_count; std::free(p);}
+ {assert(data_ >= 0); --alloc_count; ::operator delete((void*)p);}
size_type max_size() const throw()
{return UINT_MAX / sizeof(T);}
void construct(pointer p, const T& val)
@@ -134,10 +134,10 @@ public:
}
++time_to_throw;
++alloc_count;
- return (pointer)std::malloc(n * sizeof(T));
+ return (pointer)::operator new (n * sizeof(T));
}
void deallocate(pointer p, size_type n)
- {assert(data_ >= 0); --alloc_count; std::free(p);}
+ {assert(data_ >= 0); --alloc_count; ::operator delete((void*)p); }
size_type max_size() const throw()
{return UINT_MAX / sizeof(T);}
void construct(pointer p, const T& val)
@@ -200,9 +200,9 @@ public:
template <class U> other_allocator(const other_allocator<U>& a)
: data_(a.data_) {}
T* allocate(std::size_t n)
- {return (T*)std::malloc(n * sizeof(T));}
+ {return (T*)::operator new(n * sizeof(T));}
void deallocate(T* p, std::size_t n)
- {std::free(p);}
+ {::operator delete((void*)p);}
other_allocator select_on_container_copy_construction() const
{return other_allocator(-2);}
OpenPOWER on IntegriCloud