[scudo] Handle predefined M_MEMTAG_TUNING_* constants (NFC). am: fdad5742fc am: 0a778e924b am: 6d816a83e1 am: efb39a4549
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/1743161
Change-Id: I4a874e70bdfc2ea529ef092dcb5e7af505d611f2
diff --git a/standalone/include/scudo/interface.h b/standalone/include/scudo/interface.h
index 0e6cf3d..9b9a846 100644
--- a/standalone/include/scudo/interface.h
+++ b/standalone/include/scudo/interface.h
@@ -120,7 +120,7 @@
// Tune the allocator's choice of memory tags to make it more likely that
// a certain class of memory errors will be detected. The value argument should
-// be one of the enumerators of the scudo_memtag_tuning enum below.
+// be one of the M_MEMTAG_TUNING_* constants below.
#ifndef M_MEMTAG_TUNING
#define M_MEMTAG_TUNING -102
#endif
@@ -145,13 +145,15 @@
#define M_TSDS_COUNT_MAX -202
#endif
-enum scudo_memtag_tuning {
- // Tune for buffer overflows.
- M_MEMTAG_TUNING_BUFFER_OVERFLOW,
+// Tune for buffer overflows.
+#ifndef M_MEMTAG_TUNING_BUFFER_OVERFLOW
+#define M_MEMTAG_TUNING_BUFFER_OVERFLOW 0
+#endif
- // Tune for use-after-free.
- M_MEMTAG_TUNING_UAF,
-};
+// Tune for use-after-free.
+#ifndef M_MEMTAG_TUNING_UAF
+#define M_MEMTAG_TUNING_UAF 1
+#endif
} // extern "C"