Changeset View
Changeset View
Standalone View
Standalone View
lib/scudo/scudo_platform.h
Show All 11 Lines | |||||
/// | /// | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#ifndef SCUDO_PLATFORM_H_ | #ifndef SCUDO_PLATFORM_H_ | ||||
#define SCUDO_PLATFORM_H_ | #define SCUDO_PLATFORM_H_ | ||||
#include "sanitizer_common/sanitizer_allocator.h" | #include "sanitizer_common/sanitizer_allocator.h" | ||||
#if !SANITIZER_LINUX && !SANITIZER_FUCHSIA | #if !SANITIZER_LINUX && !SANITIZER_FUCHSIA && !SANITIZER_WINDOWS | ||||
# error "The Scudo hardened allocator is not supported on this platform." | # error "The Scudo hardened allocator is not supported on this platform." | ||||
#endif | #endif | ||||
#define SCUDO_TSD_EXCLUSIVE_SUPPORTED (!SANITIZER_ANDROID && !SANITIZER_FUCHSIA) | #define SCUDO_TSD_EXCLUSIVE_SUPPORTED \ | ||||
(!SANITIZER_ANDROID && !SANITIZER_FUCHSIA && !SANITIZER_WINDOWS) | |||||
#ifndef SCUDO_TSD_EXCLUSIVE | #ifndef SCUDO_TSD_EXCLUSIVE | ||||
// SCUDO_TSD_EXCLUSIVE wasn't defined, use a default TSD model for the platform. | // SCUDO_TSD_EXCLUSIVE wasn't defined, use a default TSD model for the platform. | ||||
# if SANITIZER_ANDROID || SANITIZER_FUCHSIA | # if SCUDO_TSD_EXCLUSIVE_SUPPORTED | ||||
// Android and Fuchsia use a pool of TSDs shared between threads. | |||||
# define SCUDO_TSD_EXCLUSIVE 0 | |||||
# elif SANITIZER_LINUX && !SANITIZER_ANDROID | |||||
// Non-Android Linux use an exclusive TSD per thread. | |||||
# define SCUDO_TSD_EXCLUSIVE 1 | # define SCUDO_TSD_EXCLUSIVE 1 | ||||
# else | # else | ||||
# error "No default TSD model defined for this platform." | # define SCUDO_TSD_EXCLUSIVE 0 | ||||
# endif // SANITIZER_ANDROID || SANITIZER_FUCHSIA | # endif // SCUDO_TSD_EXCLUSIVE_SUPPORTED | ||||
#endif // SCUDO_TSD_EXCLUSIVE | #else | ||||
// If the exclusive TSD model is chosen, make sure the platform supports it. | // If the exclusive TSD model is chosen, make sure the platform supports it. | ||||
#if SCUDO_TSD_EXCLUSIVE && !SCUDO_TSD_EXCLUSIVE_SUPPORTED | # if SCUDO_TSD_EXCLUSIVE && !SCUDO_TSD_EXCLUSIVE_SUPPORTED | ||||
# error "The exclusive TSD model is not supported on this platform." | # error "The exclusive TSD model is not supported on this platform." | ||||
#endif | # endif | ||||
#endif // SCUDO_TSD_EXCLUSIVE | |||||
// Maximum number of TSDs that can be created for the Shared model. | // Maximum number of TSDs that can be created for the Shared model. | ||||
#ifndef SCUDO_SHARED_TSD_POOL_SIZE | #ifndef SCUDO_SHARED_TSD_POOL_SIZE | ||||
# if SANITIZER_ANDROID | # if SANITIZER_ANDROID | ||||
# define SCUDO_SHARED_TSD_POOL_SIZE 2U | # define SCUDO_SHARED_TSD_POOL_SIZE 2U | ||||
# else | # else | ||||
# define SCUDO_SHARED_TSD_POOL_SIZE 32U | # define SCUDO_SHARED_TSD_POOL_SIZE 32U | ||||
# endif // SANITIZER_ANDROID | # endif // SANITIZER_ANDROID | ||||
Show All 40 Lines |