Commit 8b9a5b5e by Martin Liska Committed by Martin Liska

Remove not needed __builtin_expect due to malloc predictor.

2018-08-10  Martin Liska  <mliska@suse.cz>

	* libsupc++/new_op.cc (new): Remove __builtin_expect as malloc
        predictor can handle that.
	* libsupc++/new_opa.cc: Likewise.
	* libsupc++/new_opnt.cc (new): Likewise.

From-SVN: r263470
parent aa405905
2018-08-10 Martin Liska <mliska@suse.cz>
* libsupc++/new_op.cc (new): Remove __builtin_expect as malloc
predictor can handle that.
* libsupc++/new_opa.cc: Likewise.
* libsupc++/new_opnt.cc (new): Likewise.
2018-08-10 Sebastian Huber <sebastian.huber@embedded-brains.de> 2018-08-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR target/85904 PR target/85904
......
...@@ -47,7 +47,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc) ...@@ -47,7 +47,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc)
if (sz == 0) if (sz == 0)
sz = 1; sz = 1;
while (__builtin_expect ((p = malloc (sz)) == 0, false)) while ((p = malloc (sz)) == 0)
{ {
new_handler handler = std::get_new_handler (); new_handler handler = std::get_new_handler ();
if (! handler) if (! handler)
......
...@@ -126,7 +126,7 @@ operator new (std::size_t sz, std::align_val_t al) ...@@ -126,7 +126,7 @@ operator new (std::size_t sz, std::align_val_t al)
#endif #endif
using __gnu_cxx::aligned_alloc; using __gnu_cxx::aligned_alloc;
while (__builtin_expect ((p = aligned_alloc (align, sz)) == 0, false)) while ((p = aligned_alloc (align, sz)) == 0)
{ {
new_handler handler = std::get_new_handler (); new_handler handler = std::get_new_handler ();
if (! handler) if (! handler)
......
...@@ -40,7 +40,7 @@ operator new (std::size_t sz, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT ...@@ -40,7 +40,7 @@ operator new (std::size_t sz, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
if (sz == 0) if (sz == 0)
sz = 1; sz = 1;
while (__builtin_expect ((p = malloc (sz)) == 0, false)) while ((p = malloc (sz)) == 0)
{ {
new_handler handler = std::get_new_handler (); new_handler handler = std::get_new_handler ();
if (! handler) if (! handler)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment