This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fj92f3jj923f923
Recipients fj92f3jj923f923
Date 2020-07-19.10:36:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595154964.78.0.522638535626.issue41340@roundup.psfhosted.org>
In-reply-to
Content
Hi, all!

strdup implementation inside cpython/Python/strdup.c is not the best one.
It calls strlen + strcpy, which is the same as calling strlen twice + memcpy.
So I replaced it by the call of strlen + memcpy.

It is easy to look any implementation in any library.
Here for example:
https://code.woboq.org/userspace/glibc/string/strdup.c.html

So I fixed it here:
https://github.com/python/cpython/pull/21544
History
Date User Action Args
2020-07-19 10:36:04fj92f3jj923f923setrecipients: + fj92f3jj923f923
2020-07-19 10:36:04fj92f3jj923f923setmessageid: <1595154964.78.0.522638535626.issue41340@roundup.psfhosted.org>
2020-07-19 10:36:04fj92f3jj923f923linkissue41340 messages
2020-07-19 10:36:04fj92f3jj923f923create