Background thread: take base as a parameter.
This commit is contained in:
parent
29436fa056
commit
162c2bcf31
@ -27,6 +27,6 @@ extern int pthread_create_wrapper(pthread_t *__restrict, const pthread_attr_t *,
|
|||||||
void *(*)(void *), void *__restrict);
|
void *(*)(void *), void *__restrict);
|
||||||
#endif
|
#endif
|
||||||
bool background_thread_boot0(void);
|
bool background_thread_boot0(void);
|
||||||
bool background_thread_boot1(tsdn_t *tsdn);
|
bool background_thread_boot1(tsdn_t *tsdn, base_t *base);
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H */
|
#endif /* JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H */
|
||||||
|
@ -895,7 +895,7 @@ background_thread_boot0(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
background_thread_boot1(tsdn_t *tsdn) {
|
background_thread_boot1(tsdn_t *tsdn, base_t *base) {
|
||||||
#ifdef JEMALLOC_BACKGROUND_THREAD
|
#ifdef JEMALLOC_BACKGROUND_THREAD
|
||||||
assert(have_background_thread);
|
assert(have_background_thread);
|
||||||
assert(narenas_total_get() > 0);
|
assert(narenas_total_get() > 0);
|
||||||
@ -914,7 +914,7 @@ background_thread_boot1(tsdn_t *tsdn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
background_thread_info = (background_thread_info_t *)base_alloc(tsdn,
|
background_thread_info = (background_thread_info_t *)base_alloc(tsdn,
|
||||||
b0get(), opt_max_background_threads *
|
base, opt_max_background_threads *
|
||||||
sizeof(background_thread_info_t), CACHELINE);
|
sizeof(background_thread_info_t), CACHELINE);
|
||||||
if (background_thread_info == NULL) {
|
if (background_thread_info == NULL) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1820,7 +1820,8 @@ malloc_init_hard(void) {
|
|||||||
/* Set reentrancy level to 1 during init. */
|
/* Set reentrancy level to 1 during init. */
|
||||||
pre_reentrancy(tsd, NULL);
|
pre_reentrancy(tsd, NULL);
|
||||||
/* Initialize narenas before prof_boot2 (for allocation). */
|
/* Initialize narenas before prof_boot2 (for allocation). */
|
||||||
if (malloc_init_narenas() || background_thread_boot1(tsd_tsdn(tsd))) {
|
if (malloc_init_narenas()
|
||||||
|
|| background_thread_boot1(tsd_tsdn(tsd), b0get())) {
|
||||||
UNLOCK_RETURN(tsd_tsdn(tsd), true, true)
|
UNLOCK_RETURN(tsd_tsdn(tsd), true, true)
|
||||||
}
|
}
|
||||||
if (config_prof && prof_boot2(tsd, b0get())) {
|
if (config_prof && prof_boot2(tsd, b0get())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user