Kostya Serebryany | a8e7154 | 2016-06-07 01:20:26 +0000 | [diff] [blame] | 1 | //===-- scudo_flags.inc -----------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | /// |
| 10 | /// Hardened Allocator runtime flags. |
| 11 | /// |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef SCUDO_FLAG |
| 15 | # error "Define SCUDO_FLAG prior to including this file!" |
| 16 | #endif |
| 17 | |
Kostya Kortchinsky | 044cfea | 2017-02-03 20:49:42 +0000 | [diff] [blame^] | 18 | // Default value is set in scudo_flags.cpp based on architecture. |
| 19 | SCUDO_FLAG(int, QuarantineSizeMb, -1, |
Kostya Serebryany | a8e7154 | 2016-06-07 01:20:26 +0000 | [diff] [blame] | 20 | "Size (in Mb) of quarantine used to delay the actual deallocation " |
| 21 | "of chunks. Lower value may reduce memory usage but decrease the " |
| 22 | "effectiveness of the mitigation.") |
| 23 | |
Kostya Kortchinsky | 044cfea | 2017-02-03 20:49:42 +0000 | [diff] [blame^] | 24 | // Default value is set in scudo_flags.cpp based on architecture. |
| 25 | SCUDO_FLAG(int, ThreadLocalQuarantineSizeKb, -1, |
Kostya Serebryany | a8e7154 | 2016-06-07 01:20:26 +0000 | [diff] [blame] | 26 | "Size (in Kb) of per-thread cache used to offload the global " |
| 27 | "quarantine. Lower value may reduce memory usage but might increase " |
| 28 | "the contention on the global quarantine.") |
| 29 | |
| 30 | SCUDO_FLAG(bool, DeallocationTypeMismatch, true, |
| 31 | "Report errors on malloc/delete, new/free, new/delete[], etc.") |
| 32 | |
| 33 | SCUDO_FLAG(bool, DeleteSizeMismatch, true, |
| 34 | "Report errors on mismatch between size of new and delete.") |
| 35 | |
| 36 | SCUDO_FLAG(bool, ZeroContents, false, |
| 37 | "Zero chunk contents on allocation and deallocation.") |