• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision167 (tree)
Time2018-12-18 03:09:15
Authorquiret

Log Message

- replaced aligned_alloc with memalign in the Linux implementation because aligned_alloc is braindead (god bless msft)

Change Summary

Incremental Difference

--- common/sdk/eirutils.h (revision 166)
+++ common/sdk/eirutils.h (revision 167)
@@ -16,9 +16,7 @@
1616 #include <algorithm>
1717 #include <type_traits>
1818
19-#ifdef _MSC_VER
2019 #include <malloc.h>
21-#endif //_MSC_VER
2220
2321 #include "MacroUtils.h"
2422
@@ -289,7 +287,10 @@
289287 #ifdef _MSC_VER
290288 return _aligned_malloc( memSize, alignment );
291289 #else
292- return aligned_alloc( alignment, memSize );
290+ // The use of aligned_alloc is braindead because it actually requires the size to be
291+ // an integral multiple of alignment. So you can understand why Microsoft does not want
292+ // it in their CRT.
293+ return memalign( alignment, memSize );
293294 #endif //_MSC_VER
294295 }
295296
Show on old repository browser