Allow compilation of ldlt tests if targeting Windows #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use Windows-specific
_aligned_malloc
and_aligned_free
for implementing theAlignedAllocator
in the ldlt tests on Windows.I did consider making this completely platform-independent by upping the C-standard from C99 to C11 and just using
aligned_alloc
. Unfortunately, Microsoft does not support it (see https://learn.microsoft.com/en-us/cpp/standard-library/cstdlib?view=msvc-170#remarks-6) and so MinGW does not seem to provide it either. One could at least remove the posix-specific branch but that did not seem worth the standard change.I believe another option would be to implement the aligning as in the
SimpleAlignedAlloc
:spral/src/ssids/cpu/SimpleAlignedAlloc.hxx
Lines 37 to 52 in b1b7397
spral/src/ssids/cpu/NumericSubtree.hxx
Line 35 in b1b7397
reinterpret_cast
s for storing the original allocated pointer this did not seem like the best option to me either.