スレッドアリーナのヒープの先頭には heap_info オブジェクトが配置されます。

ヒープは図の通り各アリーナに複数存在することができます。
arena.c(https://github.com/MacKomatsu/glibc/blob/release/2.27/master/malloc/arena.c).
49 /* A heap is a single contiguous memory region holding (coalesceable)
50 malloc_chunks. It is allocated with mmap() and always starts at an
51 address aligned to HEAP_MAX_SIZE. */
52
53 typedef struct _heap_info
54 {
55 mstate ar_ptr; /* Arena for this heap. */
56 struct _heap_info *prev; /* Previous heap. */
57 size_t size; /* Current size in bytes. */
58 size_t mprotect_size; /* Size in bytes that has been mprotected
59 PROT_READ|PROT_WRITE. */
60 /* Make sure the following data is properly aligned, particularly
61 that sizeof (heap_info) + 2 * SIZE_SZ is a multiple of
62 MALLOC_ALIGNMENT. */
63 char pad[-6 * SIZE_SZ & MALLOC_ALIGN_MASK];
64 } heap_info;
ar_ptr は各ヒープが指しているアリーナへのポインターです。
mstate は malloc_state オブジェクトを指すポインターとなります。
malloc.h(https://github.com/MacKomatsu/glibc/blob/release/2.27/master/include/malloc.h).
14 struct malloc_state; 15 typedef struct malloc_state *mstate;
つまり mstate 型の ar_ptr はアリーナが開始するアドレスを指してるってことになります。
Copyright 2018-2019, by Masaki Komatsu