This is an archive of the discontinued LLVM Phabricator instance.

[clang] [Headers] Use the corresponding _aligned_free or __mingw_aligned_free in _mm_free
ClosedPublic

Authored by mstorsjo on Dec 3 2020, 4:35 AM.

Diff Detail

Event Timeline

mstorsjo created this revision.Dec 3 2020, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 3 2020, 4:35 AM
mstorsjo requested review of this revision.Dec 3 2020, 4:35 AM
rnk accepted this revision.Dec 3 2020, 9:49 AM

lgtm

clang/lib/Headers/mm_malloc.h
42

This has been here since 2011, and somehow nobody complained that we didn't use the corresponding __mingw_aligned_free API...

This revision is now accepted and ready to land.Dec 3 2020, 9:49 AM
mstorsjo added inline comments.Dec 3 2020, 10:58 AM
clang/lib/Headers/mm_malloc.h
42

Due to https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/crt/malloc.h#L72 (which is included implicitly from stdlib.h), it hasn't been used much at all- maybe only when using the older mingw.org headers. But I'm considering suggesting to change that bit in the mingw-w64 headers (it's a bit of a mess when used with gcc's mm_malloc.h).

For msvc based configs it would have been noticable though. But I don't know how much _mm_malloc really is used...