Add an implementation for strdup.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
small fix
libc/include/stdlib.h.def | ||
---|---|---|
17–22 ↗ | (On Diff #379188) | This feels wrong, but I'm not sure how else to get these into the header |
libc/include/stdlib.h.def | ||
---|---|---|
17–22 ↗ | (On Diff #379188) | This is a good find. Assuming that allocators are but one of the "external" functions that LLVM libc will provide, I think we should have a scalable solution for this. So, may be add a new cmake rule called add_external_entrypoint which does nothing but create a dummy target that can be listed in places like entrypoints.txt? |
libc/src/string/strdup.cpp | ||
25 | This is a C library implementation. So, the style should be snake_case for variable names. Or, you can completely avoid this conundrum by renaming the src to old and newStr to str. |
libc/include/stdlib.h.def | ||
---|---|---|
17–22 ↗ | (On Diff #379188) | +1. I wasn't able to find a better way, and was waiting for Siva for a better suggestion. |
Can we separate the CMake and allocator changes into a different patch? Rest of the patch is OK but will accept after we separate.
libc/test/src/string/CMakeLists.txt | ||
---|---|---|
100 | nit: alignment. |
This is a C library implementation. So, the style should be snake_case for variable names. Or, you can completely avoid this conundrum by renaming the src to old and newStr to str.