[PATCH] D121848: [scudo] Remove unused header includes and fix declarations
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 29 13:08:50 PDT 2022
vitalybuka 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;
----------------
ddcc wrote:
> 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?
I see, I missed cpp file
then probably in wrappers_c.h
#if !SCUDO_ANDROID || !_BIONIC
extern HIDDEN scudo::Allocator<scudo::Config, malloc_postinit> Allocator;
#endif
and remove extern in cpp file
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