EricWF requested changes to this revision. EricWF added a comment. This revision now requires changes to proceed.
Actually, I spotted a couple of issues. Requesting changes. ================ Comment at: src/experimental/memory_resource.cpp:29 +static bool is_aligned_to(void *ptr, size_t align) +{ + void *p2 = ptr; ---------------- Wait, can't this be written `reinterpret_cast<uintptr_t>(ptr) % align == 0`? ================ Comment at: src/experimental/memory_resource.cpp:48 +#ifdef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION + if (__size != 0 && !is_aligned_to(result, __align)) { + _VSTD::__libcpp_deallocate(result, __align); ---------------- Also, I'm not sure about the `size != 0` check. The returned pointer may be non-null and incorrectly aligned. Repository: rCXX libc++ https://reviews.llvm.org/D47344 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits