Miscellaneous cleanups.
This commit is contained in:
parent
d33f834591
commit
cfc5706f69
@ -361,10 +361,9 @@ prof_tctx_get(const void *ptr)
|
|||||||
assert(ptr != NULL);
|
assert(ptr != NULL);
|
||||||
|
|
||||||
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
|
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
|
||||||
if (likely(chunk != ptr)) {
|
if (likely(chunk != ptr))
|
||||||
/* Region. */
|
|
||||||
ret = arena_prof_tctx_get(ptr);
|
ret = arena_prof_tctx_get(ptr);
|
||||||
} else
|
else
|
||||||
ret = huge_prof_tctx_get(ptr);
|
ret = huge_prof_tctx_get(ptr);
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -379,10 +378,9 @@ prof_tctx_set(const void *ptr, prof_tctx_t *tctx)
|
|||||||
assert(ptr != NULL);
|
assert(ptr != NULL);
|
||||||
|
|
||||||
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
|
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
|
||||||
if (likely(chunk != ptr)) {
|
if (likely(chunk != ptr))
|
||||||
/* Region. */
|
|
||||||
arena_prof_tctx_set(ptr, tctx);
|
arena_prof_tctx_set(ptr, tctx);
|
||||||
} else
|
else
|
||||||
huge_prof_tctx_set(ptr, tctx);
|
huge_prof_tctx_set(ptr, tctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1243,7 +1243,7 @@ imalloc_prof(tsd_t *tsd, size_t usize)
|
|||||||
p = imalloc_prof_sample(tsd, usize, tctx);
|
p = imalloc_prof_sample(tsd, usize, tctx);
|
||||||
else
|
else
|
||||||
p = imalloc(tsd, usize);
|
p = imalloc(tsd, usize);
|
||||||
if (p == NULL) {
|
if (unlikely(p == NULL)) {
|
||||||
prof_alloc_rollback(tsd, tctx, true);
|
prof_alloc_rollback(tsd, tctx, true);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -1329,7 +1329,7 @@ imemalign_prof(tsd_t *tsd, size_t alignment, size_t usize)
|
|||||||
p = imemalign_prof_sample(tsd, alignment, usize, tctx);
|
p = imemalign_prof_sample(tsd, alignment, usize, tctx);
|
||||||
else
|
else
|
||||||
p = ipalloc(tsd, usize, alignment, false);
|
p = ipalloc(tsd, usize, alignment, false);
|
||||||
if (p == NULL) {
|
if (unlikely(p == NULL)) {
|
||||||
prof_alloc_rollback(tsd, tctx, true);
|
prof_alloc_rollback(tsd, tctx, true);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -1457,7 +1457,7 @@ icalloc_prof(tsd_t *tsd, size_t usize)
|
|||||||
p = icalloc_prof_sample(tsd, usize, tctx);
|
p = icalloc_prof_sample(tsd, usize, tctx);
|
||||||
else
|
else
|
||||||
p = icalloc(tsd, usize);
|
p = icalloc(tsd, usize);
|
||||||
if (p == NULL) {
|
if (unlikely(p == NULL)) {
|
||||||
prof_alloc_rollback(tsd, tctx, true);
|
prof_alloc_rollback(tsd, tctx, true);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,9 @@ prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
prof_malloc_sample_object(const void *ptr, size_t usize, prof_tctx_t *tctx) {
|
prof_malloc_sample_object(const void *ptr, size_t usize, prof_tctx_t *tctx)
|
||||||
|
{
|
||||||
|
|
||||||
prof_tctx_set(ptr, tctx);
|
prof_tctx_set(ptr, tctx);
|
||||||
|
|
||||||
malloc_mutex_lock(tctx->tdata->lock);
|
malloc_mutex_lock(tctx->tdata->lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user