We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5ced1f commit 222aa61Copy full SHA for 222aa61
1 file changed
Objects/mimalloc/init.c
@@ -183,9 +183,9 @@ mi_heap_t* _mi_heap_main_get(void) {
183
184
// note: in x64 in release build `sizeof(mi_thread_data_t)` is under 4KiB (= OS page size).
185
typedef struct mi_thread_data_s {
186
- mi_heap_t heap; // must come first due to cast in `_mi_heap_done`
+ mi_heap_t heap; // must come first due to cast in `_mi_heap_done`
187
mi_tld_t tld;
188
- mi_memid_t memid;
+ mi_memid_t memid; // must come last due to zero'ing
189
} mi_thread_data_t;
190
191
@@ -231,7 +231,7 @@ static mi_thread_data_t* mi_thread_data_zalloc(void) {
231
}
232
233
if (td != NULL && !is_zero) {
234
- _mi_memzero_aligned(td, sizeof(*td));
+ _mi_memzero_aligned(td, offsetof(mi_thread_data_t,memid));
235
236
return td;
237
0 commit comments