@@ -90,7 +90,7 @@ template <typename Config> class MapAllocatorNoCache {
90
90
public:
91
91
void init (UNUSED s32 ReleaseToOsInterval) {}
92
92
bool retrieve (UNUSED uptr Size, UNUSED CachedBlock &Entry) { return false ; }
93
- void store (UNUSED Options Options, LargeBlock::Header *H) { unmap (H); }
93
+ void store (UNUSED const Options & Options, LargeBlock::Header *H) { unmap (H); }
94
94
bool canCache (UNUSED uptr Size) { return false ; }
95
95
void disable () {}
96
96
void enable () {}
@@ -113,7 +113,7 @@ template <typename Config> class MapAllocatorNoCache {
113
113
static const uptr MaxUnusedCachePages = 4U ;
114
114
115
115
template <typename Config>
116
- bool mapSecondary (Options Options, uptr CommitBase, uptr CommitSize,
116
+ bool mapSecondary (const Options & Options, uptr CommitBase, uptr CommitSize,
117
117
uptr AllocPos, uptr Flags, MemMapT &MemMap) {
118
118
Flags |= MAP_RESIZABLE;
119
119
Flags |= MAP_ALLOWNOMEM;
@@ -179,7 +179,7 @@ template <typename Config> class MapAllocatorCache {
179
179
setOption (Option::ReleaseInterval, static_cast <sptr>(ReleaseToOsInterval));
180
180
}
181
181
182
- void store (Options Options, LargeBlock::Header *H) EXCLUDES(Mutex) {
182
+ void store (const Options & Options, LargeBlock::Header *H) EXCLUDES(Mutex) {
183
183
if (!canCache (H->CommitSize ))
184
184
return unmap (H);
185
185
@@ -407,11 +407,11 @@ template <typename Config> class MapAllocator {
407
407
S->link (&Stats);
408
408
}
409
409
410
- void *allocate (Options Options, uptr Size, uptr AlignmentHint = 0 ,
410
+ void *allocate (const Options & Options, uptr Size, uptr AlignmentHint = 0 ,
411
411
uptr *BlockEnd = nullptr ,
412
412
FillContentsMode FillContents = NoFill);
413
413
414
- void deallocate (Options Options, void *Ptr);
414
+ void deallocate (const Options & Options, void *Ptr);
415
415
416
416
static uptr getBlockEnd (void *Ptr) {
417
417
auto *B = LargeBlock::getHeader<Config>(Ptr);
@@ -443,7 +443,7 @@ template <typename Config> class MapAllocator {
443
443
}
444
444
}
445
445
446
- inline void setHeader (Options Options, CachedBlock &Entry,
446
+ inline void setHeader (const Options & Options, CachedBlock &Entry,
447
447
LargeBlock::Header *H, bool &Zeroed) {
448
448
Zeroed = Entry.Time == 0 ;
449
449
if (useMemoryTagging<Config>(Options)) {
@@ -501,8 +501,8 @@ template <typename Config> class MapAllocator {
501
501
// the committed memory will amount to something close to Size - AlignmentHint
502
502
// (pending rounding and headers).
503
503
template <typename Config>
504
- void *MapAllocator<Config>::allocate(Options Options, uptr Size, uptr Alignment ,
505
- uptr *BlockEndPtr,
504
+ void *MapAllocator<Config>::allocate(const Options & Options, uptr Size,
505
+ uptr Alignment, uptr *BlockEndPtr,
506
506
FillContentsMode FillContents) {
507
507
if (Options.get (OptionBit::AddLargeAllocationSlack))
508
508
Size += 1UL << SCUDO_MIN_ALIGNMENT_LOG;
@@ -620,7 +620,7 @@ void *MapAllocator<Config>::allocate(Options Options, uptr Size, uptr Alignment,
620
620
}
621
621
622
622
template <typename Config>
623
- void MapAllocator<Config>::deallocate(Options Options, void *Ptr)
623
+ void MapAllocator<Config>::deallocate(const Options & Options, void *Ptr)
624
624
EXCLUDES (Mutex) {
625
625
LargeBlock::Header *H = LargeBlock::getHeader<Config>(Ptr);
626
626
const uptr CommitSize = H->CommitSize ;
0 commit comments