[PATCH] D121848: [scudo] Remove unused header includes and fix declarations

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 21:53:51 PDT 2022


ddcc added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/wrappers_c.cpp:31-32
 // reality the amount of cross pollination between the two is staggering.
 SCUDO_REQUIRE_CONSTANT_INITIALIZATION
 scudo::Allocator<scudo::Config, SCUDO_PREFIX(malloc_postinit)> SCUDO_ALLOCATOR;
 
----------------
vitalybuka wrote:
> if we need extern, I assumed there is a some new user outside this cpp file.
> But I don't see benefits of having extern just before the actual var declaration.
> 
> I believe correct approach is how it's done in wrappers_c_bionic.cpp.
> 
> Separate patch for unrelated stuff will be nice. Actually each of this fixes better to have as a separate patch with "why" in description.
> 
The comment above this line seems to suggest that it's not feasible to have separate allocators for C and C++. I did try it and it seemed to work fine locally, but I suspect there may be other issues that haven't yet appeared. For example, what if a heap allocation from the C++ scudo allocator is freed by C code or vice versa?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121848



More information about the llvm-commits mailing list