[libc-commits] [PATCH] D85779: [libc] Add strtok_r implementation.

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 12 13:47:32 PDT 2020


abrachet added inline comments.


================
Comment at: libc/src/string/strtok_r.cpp:16
+
+char *LLVM_LIBC_ENTRYPOINT(strtok_r)(char *src, const char *delimiter_string,
+                                     char **saveptr) {
----------------
sivachandra wrote:
> Would it make sense to implement `strtok` and `strtok_r` over a common function which is equivalent in functionality to `strtok_r`?
Making the prototype for this function `restrict` but not the function itself doesn't allow for optimizations. `src` and `delimiter_string` should be marked `__restrict` here and I imagine in a couple of other string functions too


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85779



More information about the libc-commits mailing list