[PATCH] D77696: [Darwin] Teach `AtosSymbolizerProcess` to work on a copy of the environment.
Kuba (Brecka) Mracek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 8 17:56:52 PDT 2020
kubamracek added inline comments.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp:101
+ CHECK_LE(entries_to_copy, kMaxNumEnvPEntries);
+ internal_memcpy(custom_env_, current_env, entries_to_copy * sizeof(uptr));
+ // Null terminate the array.
----------------
Is it actually correct to not do a "deep copy" and only copy the pointers? I mean, who "owns" these strings? Are they guaranteed to live forever?
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp:128
+ // Use statically allocated array to avoid allocation at symbolization time.
+ char *custom_env_[kMaxNumEnvPEntries];
};
----------------
Can you briefly describe how tricky would it be to not have a hardcoded limit? Could an InternalMmapVector be used here instead?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77696/new/
https://reviews.llvm.org/D77696
More information about the llvm-commits
mailing list