[libc-commits] [PATCH] D82376: [libc] Add strdup implementation.

Chris Gyurgyik via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 23 06:21:55 PDT 2020


cgyurgyik created this revision.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
cgyurgyik updated this revision to Diff 272701.
cgyurgyik added a comment.
cgyurgyik updated this revision to Diff 272703.

Remove strcmp from strdup testing.


cgyurgyik added a comment.

Add length variable to call strlen once.


Adds strdup implementation. Memcpy is more efficient since we don't need to check if the character is the null terminator with each iteration.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82376

Files:
  libc/config/linux/x86_64/entrypoints.txt
  libc/src/string/CMakeLists.txt
  libc/src/string/strdup.cpp
  libc/src/string/strdup.h
  libc/test/src/string/CMakeLists.txt
  libc/test/src/string/strdup_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82376.272703.patch
Type: text/x-patch
Size: 4300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200623/47bbe523/attachment-0001.bin>


More information about the libc-commits mailing list