summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2010-03-16 17:21:52 -0700
committerAndroid Code Review <code-review@android.com>2010-03-16 17:21:52 -0700
commit5586838babaa9e8a6cf31547f4ba0d3bc333b336 (patch)
tree052572a224ddd40087bab33599d538f77d8c5d0d
parent58060c50bc4228a7d0253338cae0437211759959 (diff)
parent8f92500fa93d174d077af28d8af3e3cb732e0aff (diff)
downloadbionic-5586838babaa9e8a6cf31547f4ba0d3bc333b336.zip
bionic-5586838babaa9e8a6cf31547f4ba0d3bc333b336.tar.gz
bionic-5586838babaa9e8a6cf31547f4ba0d3bc333b336.tar.bz2
Merge "optimize delete/delete[] operators by removing unneeded branch"
-rw-r--r--libstdc++/src/new.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/libstdc++/src/new.cpp b/libstdc++/src/new.cpp
index 8189159..a9c92d4 100644
--- a/libstdc++/src/new.cpp
+++ b/libstdc++/src/new.cpp
@@ -23,16 +23,12 @@ void* operator new[](std::size_t size)
void operator delete(void* ptr)
{
- if (ptr) {
- free(ptr);
- }
+ free(ptr);
}
void operator delete[](void* ptr)
{
- if (ptr) {
- free(ptr);
- }
+ free(ptr);
}
void* operator new(std::size_t size, const std::nothrow_t&)
@@ -47,16 +43,12 @@ void* operator new[](std::size_t size, const std::nothrow_t&)
void operator delete(void* ptr, const std::nothrow_t&)
{
- if (ptr) {
- free(ptr);
- }
+ free(ptr);
}
void operator delete[](void* ptr, const std::nothrow_t&)
{
- if (ptr) {
- free(ptr);
- }
+ free(ptr);
}