mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-27 06:15:37 +03:00
Do not (recursively) allocate within tsd_fetch().
Refactor tsd so that tsdn_fetch() does not trigger allocation, since allocation could cause infinite recursion. This resolves #458.
This commit is contained in:
parent
e2bcf037d4
commit
962a2979e3
14 changed files with 176 additions and 130 deletions
|
|
@ -340,6 +340,13 @@ a0idalloc(void *ptr, bool is_metadata)
|
|||
idalloctm(TSDN_NULL, ptr, false, is_metadata, true);
|
||||
}
|
||||
|
||||
arena_t *
|
||||
a0get(void)
|
||||
{
|
||||
|
||||
return (a0);
|
||||
}
|
||||
|
||||
void *
|
||||
a0malloc(size_t size)
|
||||
{
|
||||
|
|
@ -1454,7 +1461,7 @@ malloc_init_hard(void)
|
|||
return (true);
|
||||
malloc_mutex_lock(tsd_tsdn(tsd), &init_lock);
|
||||
|
||||
if (config_prof && prof_boot2(tsd_tsdn(tsd))) {
|
||||
if (config_prof && prof_boot2(tsd)) {
|
||||
malloc_mutex_unlock(tsd_tsdn(tsd), &init_lock);
|
||||
return (true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue