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 | SCUDO_FLAG(int, QuarantineSizeMb, -1, |
Kostya Kortchinsky | 5884a66 | 2017-07-24 15:29:38 +0000 | [diff] [blame^] | 19 | "Deprecated. Please use QuarantineSizeKb.") |
| 20 | |
| 21 | // Default value is set in scudo_flags.cpp based on architecture. |
| 22 | SCUDO_FLAG(int, QuarantineSizeKb, -1, |
| 23 | "Size in KB of quarantine used to delay the actual deallocation of " |
| 24 | "chunks. Lower value may reduce memory usage but decrease the " |
| 25 | "effectiveness of the mitigation. Defaults to 64KB (32-bit) or " |
| 26 | "256KB (64-bit)") |
Kostya Serebryany | a8e7154 | 2016-06-07 01:20:26 +0000 | [diff] [blame] | 27 | |
Kostya Kortchinsky | 044cfea | 2017-02-03 20:49:42 +0000 | [diff] [blame] | 28 | // Default value is set in scudo_flags.cpp based on architecture. |
| 29 | SCUDO_FLAG(int, ThreadLocalQuarantineSizeKb, -1, |
Kostya Kortchinsky | 5884a66 | 2017-07-24 15:29:38 +0000 | [diff] [blame^] | 30 | "Size in KB of per-thread cache used to offload the global " |
Kostya Serebryany | a8e7154 | 2016-06-07 01:20:26 +0000 | [diff] [blame] | 31 | "quarantine. Lower value may reduce memory usage but might increase " |
Kostya Kortchinsky | 5884a66 | 2017-07-24 15:29:38 +0000 | [diff] [blame^] | 32 | "the contention on the global quarantine. Defaults to 16KB (32-bit) " |
| 33 | "or 64KB (64-bit)") |
| 34 | |
| 35 | // Default value is set in scudo_flags.cpp based on architecture. |
| 36 | SCUDO_FLAG(int, QuarantineChunksUpToSize, -1, |
| 37 | "Size in bytes up to which chunks will be quarantined (if lower than" |
| 38 | "or equal to). Defaults to 256 (32-bit) or 2048 (64-bit)") |
Kostya Serebryany | a8e7154 | 2016-06-07 01:20:26 +0000 | [diff] [blame] | 39 | |
| 40 | SCUDO_FLAG(bool, DeallocationTypeMismatch, true, |
| 41 | "Report errors on malloc/delete, new/free, new/delete[], etc.") |
| 42 | |
| 43 | SCUDO_FLAG(bool, DeleteSizeMismatch, true, |
| 44 | "Report errors on mismatch between size of new and delete.") |
| 45 | |
| 46 | SCUDO_FLAG(bool, ZeroContents, false, |
| 47 | "Zero chunk contents on allocation and deallocation.") |