netlist: fix aligned_alloc (PR #9801) (#9813)

This commit is contained in:
couriersud 2022-05-23 02:29:18 +02:00 committed by GitHub
parent dbc62842c1
commit 281ee9063f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,6 +431,8 @@ namespace plib {
}
return p;
#else
// see https://en.cppreference.com/w/c/memory/aligned_alloc
size = ((size + alignment - 1) / alignment) * alignment;
return static_cast<gsl::owner<void *>>(aligned_alloc(alignment, size));
#endif
#else