| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -175,9 +175,9 @@ mi_heap_t* _mi_heap_main_get(void) { | |||
| 175 | 175 | ||
| 176 | 176 | // note: in x64 in release build `sizeof(mi_thread_data_t)` is under 4KiB (= OS page size). | |
| 177 | 177 | typedef struct mi_thread_data_s { | |
| 178 | - mi_heap_t heap; // must come first due to cast in `_mi_heap_done` | ||
| 178 | + mi_heap_t heap; // must come first due to cast in `_mi_heap_done` | ||
| 179 | 179 | mi_tld_t tld; | |
| 180 | - mi_memid_t memid; | ||
| 180 | + mi_memid_t memid; // must come last due to zero'ing | ||
| 181 | 181 | } mi_thread_data_t; | |
| 182 | 182 | ||
| 183 | 183 | ||
@@ -223,7 +223,7 @@ static mi_thread_data_t* mi_thread_data_zalloc(void) { | |||
| 223 | 223 | } | |
| 224 | 224 | ||
| 225 | 225 | if (td != NULL && !is_zero) { | |
| 226 | - _mi_memzero_aligned(td, sizeof(*td)); | ||
| 226 | + _mi_memzero_aligned(td, offsetof(mi_thread_data_t,memid)); | ||
| 227 | 227 | } | |
| 228 | 228 | return td; | |
| 229 | 229 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments