Merge "Silence static analyzer warnings about memory leaks" am: 20ae530e01 am: 07406662a4

am: 64b6ce0d75

Change-Id: Ic083bb9487da697c439defdc33dec12b12bdcaca
This commit is contained in:
George Burgess IV 2017-09-25 19:50:38 +00:00 committed by android-build-merger
commit fd60591eb1
1 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,9 @@ namespace android {
class HiddenPointer {
public:
// Since we're doing such a good job of hiding it, the static analyzer
// thinks that we're leaking this `malloc`. This is probably related to
// https://bugs.llvm.org/show_bug.cgi?id=34198. NOLINTNEXTLINE
explicit HiddenPointer(size_t size = 256) { Set(malloc(size)); }
~HiddenPointer() { Free(); }
void* Get() { return reinterpret_cast<void*>(~ptr_); }