Optimize cache_bin_alloc_easy for malloc fast path

`tcache_bin_info` is not accessed on malloc fast path but the
compiler reserves a register for it, as well as an additional
register for `tcache_bin_info[ind].stack_size`.  The optimization
gets rid of the need for the two registers.
This commit is contained in:
Yinan Zhang
2019-10-08 11:33:55 -07:00
parent 4fe50bc7d0
commit 05681e387a
2 changed files with 36 additions and 10 deletions

View File

@@ -2372,7 +2372,7 @@ je_malloc(size_t size) {
cache_bin_t *bin = tcache_small_bin_get(tcache, ind);
bool tcache_success;
void *ret = cache_bin_alloc_easy(bin, &tcache_success, ind);
void *ret = cache_bin_alloc_easy_reduced(bin, &tcache_success);
if (tcache_success) {
*tsd_thread_allocatedp_get(tsd) += usize;