[libc-commits] [PATCH] D139584: [libc] Add custom operator new to handle allocation failures gracefully.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Dec 7 16:41:19 PST 2022


lntue added inline comments.


================
Comment at: libc/src/string/allocating_string_utils.h:27
+  AllocChecker ac;
+  char *newstr = new (&ac) char[len];
+  if (!ac)
----------------
Does it mean that our `strdup` will always return aligned strings?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139584



More information about the libc-commits mailing list