1*76559068SAndroid Build Coastguard Worker//===-- flags.inc -----------------------------------------------*- C++ -*-===// 2*76559068SAndroid Build Coastguard Worker// 3*76559068SAndroid Build Coastguard Worker// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*76559068SAndroid Build Coastguard Worker// See https://llvm.org/LICENSE.txt for license information. 5*76559068SAndroid Build Coastguard Worker// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*76559068SAndroid Build Coastguard Worker// 7*76559068SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 8*76559068SAndroid Build Coastguard Worker 9*76559068SAndroid Build Coastguard Worker#ifndef SCUDO_FLAG 10*76559068SAndroid Build Coastguard Worker#error "Define SCUDO_FLAG prior to including this file!" 11*76559068SAndroid Build Coastguard Worker#endif 12*76559068SAndroid Build Coastguard Worker 13*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(int, quarantine_size_kb, 0, 14*76559068SAndroid Build Coastguard Worker "Size (in kilobytes) of quarantine used to delay the actual " 15*76559068SAndroid Build Coastguard Worker "deallocation of chunks. Lower value may reduce memory usage but " 16*76559068SAndroid Build Coastguard Worker "decrease the effectiveness of the mitigation.") 17*76559068SAndroid Build Coastguard Worker 18*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(int, thread_local_quarantine_size_kb, 0, 19*76559068SAndroid Build Coastguard Worker "Size (in kilobytes) of per-thread cache used to offload the global " 20*76559068SAndroid Build Coastguard Worker "quarantine. Lower value may reduce memory usage but might increase " 21*76559068SAndroid Build Coastguard Worker "the contention on the global quarantine.") 22*76559068SAndroid Build Coastguard Worker 23*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(int, quarantine_max_chunk_size, 0, 24*76559068SAndroid Build Coastguard Worker "Size (in bytes) up to which chunks will be quarantined (if lower " 25*76559068SAndroid Build Coastguard Worker "than or equal to).") 26*76559068SAndroid Build Coastguard Worker 27*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(bool, dealloc_type_mismatch, false, 28*76559068SAndroid Build Coastguard Worker "Terminate on a type mismatch in allocation-deallocation functions, " 29*76559068SAndroid Build Coastguard Worker "eg: malloc/delete, new/free, new/delete[], etc.") 30*76559068SAndroid Build Coastguard Worker 31*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(bool, delete_size_mismatch, true, 32*76559068SAndroid Build Coastguard Worker "Terminate on a size mismatch between a sized-delete and the actual " 33*76559068SAndroid Build Coastguard Worker "size of a chunk (as provided to new/new[]).") 34*76559068SAndroid Build Coastguard Worker 35*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(bool, zero_contents, false, "Zero chunk contents on allocation.") 36*76559068SAndroid Build Coastguard Worker 37*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(bool, pattern_fill_contents, false, 38*76559068SAndroid Build Coastguard Worker "Pattern fill chunk contents on allocation.") 39*76559068SAndroid Build Coastguard Worker 40*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(bool, may_return_null, true, 41*76559068SAndroid Build Coastguard Worker "Indicate whether the allocator should terminate instead of " 42*76559068SAndroid Build Coastguard Worker "returning NULL in otherwise non-fatal error scenarios, eg: OOM, " 43*76559068SAndroid Build Coastguard Worker "invalid allocation alignments, etc.") 44*76559068SAndroid Build Coastguard Worker 45*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(int, release_to_os_interval_ms, 5000, 46*76559068SAndroid Build Coastguard Worker "Interval (in milliseconds) at which to attempt release of unused " 47*76559068SAndroid Build Coastguard Worker "memory to the OS. Negative values disable the feature.") 48*76559068SAndroid Build Coastguard Worker 49*76559068SAndroid Build Coastguard WorkerSCUDO_FLAG(int, allocation_ring_buffer_size, 32768, 50*76559068SAndroid Build Coastguard Worker "Entries to keep in the allocation ring buffer for scudo. " 51*76559068SAndroid Build Coastguard Worker "Values less or equal to zero disable the buffer.") 52