Commit 4103ac13 authored by Ian Petersen's avatar Ian Petersen Committed by Facebook GitHub Bot

Modify folly::coro's Malloc.cpp to support iOS <10.0

Summary:
Sized deallocation (introduced in C++14) is only available on iOS after 10.0.
This diff changes `folly_coro_async_free` to use `operator delete(void*)` when
`operator delete(void*, size_t)` is unavailable.

Reviewed By: yfeldblum

Differential Revision: D21492467

fbshipit-source-id: 2afef1d3d2aa6c70fec5f49e5d62a4a594e6da83
parent aeabaf80
......@@ -34,7 +34,13 @@ void* folly_coro_async_malloc(std::size_t size) {
FOLLY_NOINLINE
void folly_coro_async_free(void* ptr, std::size_t size) {
#if __cpp_sized_deallocation >= 201309
::operator delete(ptr, size);
#else
// sized delete is not available on iOS before 10.0
(void)size;
::operator delete(ptr);
#endif
// Add this after the call to prevent the compiler from
// turning the call to operator delete() into a tailcall.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment