mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-19 18:35:39 +03:00
Apply likely()/unlikely() to allocation/deallocation fast paths.
This commit is contained in:
parent
91566fc079
commit
9c640bfdd4
8 changed files with 138 additions and 129 deletions
|
|
@ -141,12 +141,12 @@ quarantine(void *ptr)
|
|||
obj->usize = usize;
|
||||
quarantine->curbytes += usize;
|
||||
quarantine->curobjs++;
|
||||
if (config_fill && opt_junk) {
|
||||
if (config_fill && unlikely(opt_junk)) {
|
||||
/*
|
||||
* Only do redzone validation if Valgrind isn't in
|
||||
* operation.
|
||||
*/
|
||||
if ((config_valgrind == false || in_valgrind == false)
|
||||
if ((!config_valgrind || likely(!in_valgrind))
|
||||
&& usize <= SMALL_MAXCLASS)
|
||||
arena_quarantine_junk_small(ptr, usize);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue