summaryrefslogtreecommitdiffstats
path: root/include/__sso_allocator
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-06-04 19:54:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-06-04 19:54:15 +0000
commit73c1fce21cb164d035ae2d432b30556127a2e836 (patch)
treecfe4877239bca9c2117ee0087ee80be36bb2d6b6 /include/__sso_allocator
parent0707b67ac33ee7584be43a2ed2902e61006813b7 (diff)
downloadexternal_libcxx-73c1fce21cb164d035ae2d432b30556127a2e836.tar.gz
external_libcxx-73c1fce21cb164d035ae2d432b30556127a2e836.tar.bz2
external_libcxx-73c1fce21cb164d035ae2d432b30556127a2e836.zip
Use __builtin_operator_new/__builtin_operator_delete when available. This
allows allocations and deallocations to be optimized out. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/__sso_allocator')
-rw-r--r--include/__sso_allocator4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/__sso_allocator b/include/__sso_allocator
index 7240072ca..645f2ba17 100644
--- a/include/__sso_allocator
+++ b/include/__sso_allocator
@@ -55,14 +55,14 @@ public:
__allocated_ = true;
return (pointer)&buf_;
}
- return static_cast<pointer>(::operator new(__n * sizeof(_Tp)));
+ return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));
}
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type)
{
if (__p == (pointer)&buf_)
__allocated_ = false;
else
- ::operator delete(__p);
+ _VSTD::__deallocate(__p);
}
_LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}