add attr_noexept for better codegen on msvc

This commit is contained in:
daanx 2024-12-26 10:28:36 -08:00
parent b70fd1093a
commit f72ac7a5aa
2 changed files with 5 additions and 5 deletions

View file

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

View file

@ -48,10 +48,10 @@ static inline void mi_free_block_local(mi_page_t* page, mi_block_t* block, bool
} }
// Forward declaration for multi-threaded collect // Forward declaration for multi-threaded collect
static void mi_decl_noinline mi_free_try_collect_mt(mi_page_t* page); static void mi_decl_noinline mi_free_try_collect_mt(mi_page_t* page) mi_attr_noexcept;
// Free a block multi-threaded // Free a block multi-threaded
static inline void mi_free_block_mt(mi_page_t* page, mi_block_t* block) static inline void mi_free_block_mt(mi_page_t* page, mi_block_t* block) mi_attr_noexcept
{ {
// adjust stats (after padding check and potentially recursive `mi_free` above) // adjust stats (after padding check and potentially recursive `mi_free` above)
mi_stat_free(page, block); // stat_free may access the padding mi_stat_free(page, block); // stat_free may access the padding
@ -195,7 +195,7 @@ void mi_free(void* p) mi_attr_noexcept
// ------------------------------------------------------ // ------------------------------------------------------
static void mi_decl_noinline mi_free_try_collect_mt(mi_page_t* page) { static void mi_decl_noinline mi_free_try_collect_mt(mi_page_t* page) mi_attr_noexcept {
mi_assert_internal(mi_page_is_owned(page)); mi_assert_internal(mi_page_is_owned(page));
mi_assert_internal(mi_page_is_abandoned(page)); mi_assert_internal(mi_page_is_abandoned(page));