[compiler-rt] Allow to override allocation buffer size with a separate env var (PR #71703)

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 13:09:32 PST 2023


================
@@ -68,6 +69,13 @@ void initFlags() {
   Parser.parseString(getCompileDefinitionScudoDefaultOptions());
   Parser.parseString(getScudoDefaultOptions());
   Parser.parseString(getEnv("SCUDO_OPTIONS"));
+  if (const char *V = getEnv("SCUDO_ALLOCATION_RING_BUFFER_SIZE")) {
----------------
cferris1000 wrote:

Could you replace this with FlagsParser::runHandler("SCUDO_ALLOCATOR_RING_BUFFER_SIZE", V)? I know it's not a public function, but maybe make a version that is public, one that doesn't return a bool and handles the error internally?

I think you should still do some kind of verification of this parameter because it makes me nervous if you plan to expose this, we should probably add more verification to all of the flags read in the flags parser code.

https://github.com/llvm/llvm-project/pull/71703


More information about the llvm-commits mailing list