improve TLS access on Windows with msvc (by Frank Richter, issue #1078)

This commit is contained in:
daanx 2025-05-04 09:04:57 -07:00
parent 417e8176bd
commit e4c5d09d65
2 changed files with 6 additions and 3 deletions

View file

@ -282,8 +282,8 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="mimalloc-lib.vcxproj">
<Project>{abb5eae7-b3e6-432e-b636-333449892ea6}</Project>
<ProjectReference Include="mimalloc-override-dll.vcxproj">
<Project>{abb5eae7-b3e6-432e-b636-333449892ea7}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View file

@ -270,6 +270,9 @@ static inline void mi_prim_tls_slot_set(size_t slot, void* value) mi_attr_noexce
// defined in `init.c`; do not use these directly
#ifdef _MSC_VER
__declspec(selectany) // make it part of the comdat section to have faster TLS access (issue #1078)
#endif
extern mi_decl_thread mi_heap_t* _mi_heap_default; // default heap to allocate from
extern bool _mi_process_is_initialized; // has mi_process_init been called?