Loading libs/binder/MemoryDealer.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,15 @@ SimpleBestFitAllocator::SimpleBestFitAllocator(size_t size) SimpleBestFitAllocator::~SimpleBestFitAllocator() { while(!mList.isEmpty()) { delete mList.remove(mList.head()); chunk_t* removed = mList.remove(mList.head()); #ifdef __clang_analyzer__ // Clang static analyzer gets confused in this loop // and generates a false positive warning about accessing // memory that is already freed. // Add an "assert" to avoid the confusion. LOG_ALWAYS_FATAL_IF(mList.head() == removed); #endif delete removed; } } Loading Loading
libs/binder/MemoryDealer.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,15 @@ SimpleBestFitAllocator::SimpleBestFitAllocator(size_t size) SimpleBestFitAllocator::~SimpleBestFitAllocator() { while(!mList.isEmpty()) { delete mList.remove(mList.head()); chunk_t* removed = mList.remove(mList.head()); #ifdef __clang_analyzer__ // Clang static analyzer gets confused in this loop // and generates a false positive warning about accessing // memory that is already freed. // Add an "assert" to avoid the confusion. LOG_ALWAYS_FATAL_IF(mList.head() == removed); #endif delete removed; } } Loading