1
0
mirror of https://git.code.sf.net/p/mingw-w64/mingw-w64 synced 2025-04-18 17:44:18 +03:00
Pali Rohár b8a0910a88 crt: Change mingw-aligned-malloc.c to be compatible with MS CRT functions
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>
2025-04-09 14:32:27 +03:00
2010-02-24 17:55:02 +00:00
2013-02-26 20:29:09 +00:00
2010-01-15 20:22:39 +00:00
Description
No description provided
67 MiB
Languages
C 62.8%
C++ 20.7%
Makefile 15.2%
Shell 1%
Yacc 0.1%
Other 0.1%