Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
bd24155b
Commit
bd24155b
authored
Nov 16, 2019
by
Francesco Biscani
Committed by
Wenzel Jakob
Nov 16, 2019
Browse files
Aligned allocation fix for clang-cl (#1988)
parent
deb3cb23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
include/pybind11/cast.h
include/pybind11/cast.h
+1
-1
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+1
-1
No files found.
include/pybind11/cast.h
View file @
bd24155b
...
@@ -591,7 +591,7 @@ public:
...
@@ -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
def
ined(
__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
));
...
...
include/pybind11/pybind11.h
View file @
bd24155b
...
@@ -1003,7 +1003,7 @@ void call_operator_delete(T *p, size_t s, size_t) { T::operator delete(p, s); }
...
@@ -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
def
ined(
__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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment