[PATCH] [ASan] Introduce AllocatorOptions to configure allocator behavior.

Kostya Serebryany kcc at google.com
Wed Dec 17 14:15:50 PST 2014


Some of these options may be accessed on fast path, so I'd like to have the struct as small as possible


================
Comment at: lib/asan/asan_allocator.cc:222
@@ +221,3 @@
+  atomic_uint8_t alloc_dealloc_mismatch;
+  atomic_uint32_t min_redzone;
+  atomic_uint32_t max_redzone;
----------------
maybe u16? 

================
Comment at: lib/asan/asan_allocator.h:35
@@ +34,3 @@
+struct AllocatorOptions {
+  bool may_return_null;
+  uptr quarantine_size;
----------------
group the fields so that the struct is as small as possible.
also make quarantine_size quarantine_size_mb (for now, only the internal one, but I'd love to make the external flag to be _mb too).
and make it u32

================
Comment at: lib/asan/asan_allocator.h:38
@@ +37,3 @@
+  bool alloc_dealloc_mismatch;
+  int min_redzone;
+  int max_redzone;
----------------
maybe u16?

http://reviews.llvm.org/D6711

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list