mirror of
https://git.code.sf.net/p/mingw-w64/mingw-w64
synced 2025-04-18 17:44:18 +03:00
MS CRT libraries (UCRT, msvcr70+ and os system msvcrt) for functions _aligned_malloc() and _aligned_offset_malloc() allocate the source buffer slightly smaller than the mingw-w64 functions in mingw-aligned-malloc.c. This is because the alignment gap can be used for the user data too. Do exactly same math calculation in the mingw-w64 implementation as is UCRT doing. Same calculation is in msvcr70 and probably also in system msvcrt library (at least different _msize() tests confirms it). This will allow to call __mingw_aligned_msize() on buffer allocated by MS CRT _aligned_malloc() function from msvcrt.dll, msvcr70.dll and msvcrt71.dll CRT libraries. This is very useful because these CRT libraries do not have _aligned_msize() function and hence mingw-w64 could emulate it via __mingw_aligned_msize(). Signed-off-by: Martin Storsjö <martin@martin.st>
Description
No description provided
Languages
C
62.8%
C++
20.7%
Makefile
15.2%
Shell
1%
Yacc
0.1%
Other
0.1%