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

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 26 00:47:05 PDT 2022


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/common.h:120
 extern uptr PageSizeCached;
+uptr getPageSize();
 uptr getPageSizeSlow();
----------------
There is the same in cpp file.
I believe the point was to hide declaration from the header to avoid use by mistake.




================
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;
 
----------------
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.



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