[libcxx-commits] [PATCH] D110846: [libcxx] Make allocator<T>:allocate throw bad_array_new_length

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 1 09:30:47 PDT 2021


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

I'm fine with the change in itself, however if we introduce a new function in the dylib, we'll need to be clever about rolling it out. If someone tries to back-deploy to an older OS where that function isn't in the dylib, they'll get an error when their binary is loaded cause it'll rely on the non-existent symbol. This can be worked around by looking at the deployment target and only relying on the symbol if we're on a target that has the symbol, but that's more complicated. Instead, I would suggest just making this an `inline` function in the header, similarly to what we do for `__throw_bad_any_cast` and some others.



================
Comment at: libcxx/include/new:151
 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc();  // not in C++ spec
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __libcpp_throw_bad_array_new_length();
 
----------------
For consistency?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110846/new/

https://reviews.llvm.org/D110846



More information about the libcxx-commits mailing list