Browse Source

Use _aligned_malloc instead

pull/2274/head
Max Lv 6 years ago
parent
commit
4fb34de463
2 changed files with 5 additions and 3 deletions
  1. 4
      docker/mingw/build.sh
  2. 4
      src/utils.c

4
docker/mingw/build.sh

@ -51,7 +51,7 @@ build_proj() {
CFLAGS="-DCARES_STATICLIB -DPCRE_STATIC"
make clean
make -j$cpu LDFLAGS="-all-static -L${dep}/lib"
make install-strip
make install
# Reference SIP003 plugin (Experimental)
[[ "${PLUGIN}" != "true" ]] && return 0
@ -74,7 +74,7 @@ build_proj() {
--with-ev="$dep"
make clean
make -j$cpu LDFLAGS="-all-static -L${dep}/lib"
make install-strip
make install
}
dk_build() {

4
src/utils.c

@ -32,6 +32,8 @@
#include <errno.h>
#include <pwd.h>
#include <grp.h>
#else
#include <malloc.h>
#endif
#include <sys/types.h>
@ -249,7 +251,7 @@ ss_align(size_t size)
/* ensure 16 byte alignment */
err = posix_memalign(&tmp, 16, size);
#elif __MINGW32__
tmp = __mingw_aligned_malloc(size, 16);
tmp = _aligned_malloc(size, 16);
err = tmp == NULL;
#else
err = -1;

Loading…
Cancel
Save