Skip to content

Commit

Permalink
Aligned allocation fix for clang-cl (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni authored and wjakob committed Nov 16, 2019
1 parent deb3cb2 commit bd24155
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class type_caster_generic {
if (type->operator_new) {
vptr = type->operator_new(type->type_size);
} else {
#ifdef __cpp_aligned_new
#if defined(__cpp_aligned_new) && (!defined(_MSC_VER) || _MSC_VER >= 1912)
if (type->type_align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
vptr = ::operator new(type->type_size,
std::align_val_t(type->type_align));
Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
(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__) {
#ifdef __cpp_sized_deallocation
::operator delete(p, s, std::align_val_t(a));
Expand Down

0 comments on commit bd24155

Please sign in to comment.