Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
1819ae581c | |
![]() |
1ba886fb69 |
19
src/arena.c
19
src/arena.c
|
@ -358,9 +358,9 @@ arena_cactive_update(arena_t *arena, size_t add_pages, size_t sub_pages)
|
|||
{
|
||||
|
||||
if (config_stats) {
|
||||
ssize_t cactive_diff = CHUNK_CEILING((arena->nactive +
|
||||
add_pages) << LG_PAGE) - CHUNK_CEILING((arena->nactive -
|
||||
sub_pages) << LG_PAGE);
|
||||
ssize_t cactive_diff = CHUNK_CEILING((arena->nactive + add_pages
|
||||
- sub_pages) << LG_PAGE) - CHUNK_CEILING(arena->nactive <<
|
||||
LG_PAGE);
|
||||
if (cactive_diff != 0)
|
||||
stats_cactive_add(cactive_diff);
|
||||
}
|
||||
|
@ -1479,8 +1479,19 @@ arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind,
|
|||
ptr = arena_run_reg_alloc(run, &arena_bin_info[binind]);
|
||||
else
|
||||
ptr = arena_bin_malloc_hard(arena, bin);
|
||||
if (ptr == NULL)
|
||||
if (ptr == NULL) {
|
||||
/*
|
||||
* OOM. tbin->avail isn't yet filled down to its first
|
||||
* element, so the successful allocations (if any) must
|
||||
* be moved to the base of tbin->avail before bailing
|
||||
* out.
|
||||
*/
|
||||
if (i > 0) {
|
||||
memmove(tbin->avail, &tbin->avail[nfill - i],
|
||||
i * sizeof(void *));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (config_fill && opt_junk) {
|
||||
arena_alloc_junk_small(ptr, &arena_bin_info[binind],
|
||||
true);
|
||||
|
|
Loading…
Reference in New Issue