mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
Aligned allocation fix for clang-cl (#1988)
This commit is contained in:
parent
deb3cb238a
commit
bd24155b8b
@ -591,7 +591,7 @@ public:
|
|||||||
if (type->operator_new) {
|
if (type->operator_new) {
|
||||||
vptr = type->operator_new(type->type_size);
|
vptr = type->operator_new(type->type_size);
|
||||||
} else {
|
} else {
|
||||||
#ifdef __cpp_aligned_new
|
#if defined(__cpp_aligned_new) && (!defined(_MSC_VER) || _MSC_VER >= 1912)
|
||||||
if (type->type_align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
|
if (type->type_align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
|
||||||
vptr = ::operator new(type->type_size,
|
vptr = ::operator new(type->type_size,
|
||||||
std::align_val_t(type->type_align));
|
std::align_val_t(type->type_align));
|
||||||
|
@ -1003,7 +1003,7 @@ void call_operator_delete(T *p, size_t s, size_t) { T::operator delete(p, s); }
|
|||||||
|
|
||||||
inline void call_operator_delete(void *p, size_t s, size_t a) {
|
inline void call_operator_delete(void *p, size_t s, size_t a) {
|
||||||
(void)s; (void)a;
|
(void)s; (void)a;
|
||||||
#ifdef __cpp_aligned_new
|
#if defined(__cpp_aligned_new) && (!defined(_MSC_VER) || _MSC_VER >= 1912)
|
||||||
if (a > __STDCPP_DEFAULT_NEW_ALIGNMENT__) {
|
if (a > __STDCPP_DEFAULT_NEW_ALIGNMENT__) {
|
||||||
#ifdef __cpp_sized_deallocation
|
#ifdef __cpp_sized_deallocation
|
||||||
::operator delete(p, s, std::align_val_t(a));
|
::operator delete(p, s, std::align_val_t(a));
|
||||||
|
Loading…
Reference in New Issue
Block a user