Optimize ixalloc by avoiding a size lookup.

This commit is contained in:
Qi Wang
2018-06-04 13:36:06 -07:00
committed by Qi Wang
parent c834912aa9
commit 0ff7ff3ec7
4 changed files with 27 additions and 15 deletions

View File

@@ -2834,14 +2834,14 @@ label_oom:
JEMALLOC_ALWAYS_INLINE size_t
ixallocx_helper(tsdn_t *tsdn, void *ptr, size_t old_usize, size_t size,
size_t extra, size_t alignment, bool zero) {
size_t usize;
size_t newsize;
if (ixalloc(tsdn, ptr, old_usize, size, extra, alignment, zero)) {
if (ixalloc(tsdn, ptr, old_usize, size, extra, alignment, zero,
&newsize)) {
return old_usize;
}
usize = isalloc(tsdn, ptr);
return usize;
return newsize;
}
static size_t