Skip to content

Commit 5cf4959

Browse files
authored
[scudo] Move getPageSize() decl to common.h header (llvm#157146)
The getPageSize() function is defined in the platform-specific source files but used in common.cpp. Every function used across files should be declared in a header so the same declaration is in scope for the callers and the definition.
1 parent 97086d6 commit 5cf4959

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler-rt/lib/scudo/standalone/common.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ namespace scudo {
1616
uptr PageSizeCached = 0;
1717
uptr PageSizeLogCached = 0;
1818

19-
// Must be defined in platform specific code.
20-
uptr getPageSize();
21-
2219
// This must be called in the init path or there could be a race if multiple
2320
// threads try to set the cached values.
2421
uptr getPageSizeSlow() {

compiler-rt/lib/scudo/standalone/common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ inline constexpr uptr getPageSizeLogCached() {
148148
extern uptr PageSizeCached;
149149
extern uptr PageSizeLogCached;
150150

151+
// Must be defined in platform specific code.
152+
uptr getPageSize();
153+
154+
// Always calls getPageSize(), but caches the results for get*Cached(), below.
151155
uptr getPageSizeSlow();
152156

153157
inline uptr getPageSizeCached() {

0 commit comments

Comments
 (0)