We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86d1585 commit d7a72c4Copy full SHA for d7a72c4
1 file changed
src/init.c
@@ -175,9 +175,9 @@ mi_heap_t* _mi_heap_main_get(void) {
175
176
// note: in x64 in release build `sizeof(mi_thread_data_t)` is under 4KiB (= OS page size).
177
typedef struct mi_thread_data_s {
178
- 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`
179
mi_tld_t tld;
180
- mi_memid_t memid;
+ mi_memid_t memid; // must come last due to zero'ing
181
} mi_thread_data_t;
182
183
@@ -223,7 +223,7 @@ static mi_thread_data_t* mi_thread_data_zalloc(void) {
223
}
224
225
if (td != NULL && !is_zero) {
226
- _mi_memzero_aligned(td, sizeof(*td));
+ _mi_memzero_aligned(td, offsetof(mi_thread_data_t,memid));
227
228
return td;
229
0 commit comments