@@ -212,14 +212,14 @@ struct QuarantineCallback {
212
212
stack_ (stack) {
213
213
}
214
214
215
- void PreQuarantine (AsanChunk *m) {
215
+ void PreQuarantine (AsanChunk *m) const {
216
216
FillChunk (m);
217
217
// Poison the region.
218
218
PoisonShadow (m->Beg (), RoundUpTo (m->UsedSize (), ASAN_SHADOW_GRANULARITY),
219
219
kAsanHeapFreeMagic );
220
220
}
221
221
222
- void Recycle (AsanChunk *m) {
222
+ void Recycle (AsanChunk *m) const {
223
223
void *p = get_allocator ().GetBlockBegin (m);
224
224
if (p != m) {
225
225
// Clear the magic value, as allocator internals may overwrite the
@@ -244,23 +244,21 @@ struct QuarantineCallback {
244
244
get_allocator ().Deallocate (cache_, p);
245
245
}
246
246
247
- void RecyclePassThrough (AsanChunk *m) {
247
+ void RecyclePassThrough (AsanChunk *m) const {
248
248
// TODO: We don't need all these here.
249
249
PreQuarantine (m);
250
250
Recycle (m);
251
251
}
252
252
253
- void *Allocate (uptr size) {
253
+ void *Allocate (uptr size) const {
254
254
void *res = get_allocator ().Allocate (cache_, size, 1 );
255
255
// TODO(alekseys): Consider making quarantine OOM-friendly.
256
256
if (UNLIKELY (!res))
257
257
ReportOutOfMemory (size, stack_);
258
258
return res;
259
259
}
260
260
261
- void Deallocate (void *p) {
262
- get_allocator ().Deallocate (cache_, p);
263
- }
261
+ void Deallocate (void *p) const { get_allocator ().Deallocate (cache_, p); }
264
262
265
263
private:
266
264
AllocatorCache* const cache_;
0 commit comments