Files
jemalloc/test/unit
Dmitry Ilvokhin 499f306859 Fix arena 0 deferral_allowed flag init
Arena 0 have a dedicated initialization path, which differs from
initialization path of other arenas. The main difference for the purpose
of this change is that we initialize arena 0 before we initialize
background threads. HPA shard options have `deferral_allowed` flag which
should be equal to `background_thread_enabled()` return value, but it
wasn't the case before this change, because for arena 0
`background_thread_enabled()` was initialized correctly after arena 0
initialization phase already ended.

Below is initialization sequence for arena 0 after this commit to
illustrate everything still should be initialized correctly.

* `hpa_central_init` initializes HPA Central, before we initialize every
  HPA shard (including arena's 0).
* `background_thread_boot1` initializes `background_thread_enabled()`
  return value.
* `pa_shard_enable_hpa` initializes arena 0 HPA shard.

```
                       malloc_init_hard -------------
                      /           /                  \
                     /           /                    \
                    /           /                      \
malloc_init_hard_a0_locked  background_thread_boot1  pa_shard_enable_hpa
        /                     /                          \
       /                     /                            \
      /                     /                              \
arena_boot       background_thread_enabled_seta         hpa_shard_init
     |
     |
pa_central_init
     |
     |
hpa_central_init
```
2025-02-18 12:10:35 -08:00
..
2020-02-19 16:03:16 -08:00
2021-12-23 10:55:08 -08:00
2021-12-23 10:55:08 -08:00
2020-07-31 09:16:50 -07:00
2020-07-31 09:16:50 -07:00
2023-09-06 10:47:14 -07:00
2020-07-31 09:16:50 -07:00
2024-05-22 10:30:31 -07:00
2024-05-22 10:30:31 -07:00
2018-12-03 17:17:03 -08:00
2023-05-08 15:00:02 -07:00
2020-04-01 09:41:20 -07:00
2020-02-19 16:03:16 -08:00
2020-05-12 08:23:15 -07:00
2021-09-17 16:56:41 -07:00
2020-02-19 16:03:16 -08:00
2021-06-24 07:40:28 -07:00
2024-05-22 10:30:31 -07:00
2021-02-04 20:58:31 -08:00
2021-07-12 17:59:18 -07:00
2021-06-24 07:40:28 -07:00
2020-03-31 06:25:08 -07:00
2020-02-19 16:03:16 -08:00
2021-06-24 14:55:49 -07:00
2020-02-19 16:03:16 -08:00
2020-02-19 16:03:16 -08:00
2023-05-08 15:00:02 -07:00
2020-02-19 16:03:16 -08:00
2017-05-18 11:33:45 -07:00
2020-02-19 16:03:16 -08:00
2020-10-05 19:55:57 -07:00
2024-04-09 12:57:01 -07:00
2024-07-30 10:29:30 -07:00
2021-12-23 10:55:08 -08:00
2017-04-21 10:06:12 -07:00
2024-04-09 12:57:01 -07:00
2021-12-23 10:55:08 -08:00
2019-12-30 15:58:57 -08:00
2020-04-06 09:50:27 -07:00
2020-04-06 09:50:27 -07:00
2021-12-23 10:55:08 -08:00
2021-09-27 16:05:13 -07:00
2021-12-15 10:39:17 -08:00
2020-02-19 16:03:16 -08:00
2020-02-19 16:03:16 -08:00
2020-02-19 16:03:16 -08:00
2023-05-08 15:00:02 -07:00
2022-04-25 11:29:00 -07:00
2020-03-12 13:55:00 -07:00
2023-04-05 10:16:37 -07:00
2022-01-04 11:03:51 -08:00
2020-02-19 16:03:16 -08:00
2020-02-19 16:03:16 -08:00