Merge branch 'dev'
This commit is contained in:
commit
e139ab8b4f
@ -254,7 +254,6 @@ arena_run_reg_alloc(arena_run_t *run, arena_bin_t *bin)
|
||||
run->nfree--;
|
||||
ret = run->avail;
|
||||
if (ret != NULL) {
|
||||
run->avail = *(void **)ret;
|
||||
/* Double free can cause assertion failure.*/
|
||||
assert(ret != NULL);
|
||||
/* Write-after free can cause assertion failure. */
|
||||
@ -264,6 +263,7 @@ arena_run_reg_alloc(arena_run_t *run, arena_bin_t *bin)
|
||||
assert(((uintptr_t)ret - ((uintptr_t)run +
|
||||
(uintptr_t)bin->reg0_offset)) % (uintptr_t)bin->reg_size ==
|
||||
0);
|
||||
run->avail = *(void **)ret;
|
||||
return (ret);
|
||||
}
|
||||
ret = run->next;
|
||||
|
@ -324,6 +324,7 @@ malloc_init_hard(void)
|
||||
CPU_SPINWAIT;
|
||||
malloc_mutex_lock(&init_lock);
|
||||
} while (malloc_initialized == false);
|
||||
malloc_mutex_unlock(&init_lock);
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
@ -239,17 +239,16 @@ prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max)
|
||||
}
|
||||
|
||||
/*
|
||||
* Iterate over stack frames until there are no more. Heap-allocate
|
||||
* and iteratively grow a larger bt if necessary.
|
||||
* Iterate over stack frames until there are no more, or until no space
|
||||
* remains in bt.
|
||||
*/
|
||||
for (i = 0; i < max; i++) {
|
||||
unw_get_reg(&cursor, UNW_REG_IP, (unw_word_t *)&bt->vec[i]);
|
||||
bt->len++;
|
||||
err = unw_step(&cursor);
|
||||
if (err <= 0) {
|
||||
bt->len = i;
|
||||
if (err <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user