[PATCH] D128971: [BOLT] Avoid implicit memset in hugify

Alexey Moksyakov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 01:32:13 PDT 2022


yavtuk added a comment.

In D128971#3624447 <https://reviews.llvm.org/D128971#3624447>, @yota9 wrote:

> 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?

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


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128971



More information about the llvm-commits mailing list