if (MAX_TCACHE_SIZE >= GLRO (dl_pagesize) / 2)
malloc_printerr ("max tcache size too large");
- /* Preserve errno when called from free() - _int_malloc may corrupt it. */
- int err = errno;
-
arena_get (ar_ptr, bytes);
victim = _int_malloc (ar_ptr, bytes);
if (!victim && ar_ptr != NULL)
if (ar_ptr != NULL)
__libc_lock_unlock (ar_ptr->mutex);
- __set_errno (err);
-
/* In a low memory situation, we may not be able to allocate memory
- in which case, we just keep trying later. However, we
typically do this very early, so either there is sufficient
size_t tc_idx = csize2tidx (tbytes);
- MAYBE_INIT_TCACHE ();
-
if (tcache_available (tc_idx))
- *memptr = tcache_get (tc_idx);
+ {
+ *memptr = tcache_get (tc_idx);
+ return false;
+ }
else
*memptr = NULL;
+ MAYBE_INIT_TCACHE ();
return false;
}
}
size_t tc_idx = csize2tidx (tbytes);
- MAYBE_INIT_TCACHE ();
-
if (tcache_available (tc_idx))
{
/* The tcache itself isn't encoded, but the chain is. */
return tag_new_usable (victim);
}
}
+ MAYBE_INIT_TCACHE ();
}
#endif
{
mfastbinptr *fb; /* associated fastbin */
- MAYBE_INIT_TCACHE ();
-
/*
If eligible, place chunk on a fastbin so it can be found
and used quickly in malloc.