[PATCH] Interceptors etc for standalone LSan.
Kostya Serebryany
kcc at google.com
Tue Apr 30 05:59:32 PDT 2013
(first few, more to go).
In general:
- try to split into even smaller CLs
- if a CL depends on some files, commit those files first.
================
Comment at: lib/lsan/lsan_allocator.h:25
@@ +24,3 @@
+struct ChunkMetadata {
+ bool allocated : 8; // Must be first.
+ uptr tag : 2;
----------------
bool is always 8 bits. maybe make it u8?
(also, make sure to run lint)
================
Comment at: lib/lsan/lsan_allocator.cc:57
@@ +56,3 @@
+ m->requested_size = size;
+ atomic_store((atomic_uint8_t*)m, 1, memory_order_relaxed);
+}
----------------
Why not &m->allocated ?
(Then m->allocated does not *have* to be first)
================
Comment at: lib/lsan/lsan_allocator.h:20
@@ +19,3 @@
+#include "sanitizer_common/sanitizer_internal_defs.h"
+#include "lsan.h"
+
----------------
this is not committed yet, right?
================
Comment at: lib/lsan/lsan_interceptors.cc:231
@@ +230,3 @@
+
+// TODO(smatveev): find a home for this
+void Init() {
----------------
resolve TODO (lsan.cc ?)
================
Comment at: lib/lsan/lsan_stack.cc:46
@@ +45,3 @@
+void PrintStackTrace(const uptr *trace, uptr size, bool symbolize) {
+ static char current_path[256];
+ static bool getcwd_attempted;
----------------
static??? Please don't
http://llvm-reviews.chandlerc.com/D702
More information about the llvm-commits
mailing list