This patch removes memset usage from C library
relative to https://reviews.llvm.org/D128960 commit
Details
Details
- Reviewers
maksfb rafaelauler rafauler Amir
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Before landing, please retitle the diff to e.g. "[BOLT] Avoid implicit memset in hugify", and amend the commit message to reflect the change.
Comment Actions
Just curious is there any reason to memset this buffer? It will be overwritten by read anyway, probably buf[0] = '\0' is more then enough here. And looks like the size might be truncated to smth like 32-64, what do you think?
bolt/runtime/hugify.cpp | ||
---|---|---|
39 | This is OOS but sizeof(buf) if you don't mind |
Comment Actions
I agree with __read, I am going to suggest a patch with Hugify support for PIE binaries soon, and this commit contains sizeof(buf).
buf[0] = '\0' vs memSet
In my thoughts both options are available here because it doesn’t affect performance
This is OOS but sizeof(buf) if you don't mind