message: Cleanups to BFCAllocator::FreeAndMaybeCoalesce.
  No functional change.
diff: @@ -465,49 +465,33 @@ void BFCAllocator::FreeAndMaybeCoalesce(BFCAllocator::ChunkHandle h) {
  Chunk* c = ChunkFromHandle(h);
  CHECK(c->in_use() && (c->bin_num == kInvalidBinNum));
  - // Mark the chunk as no longer in use
  + // Mark the chunk as no longer in use.
  c->allocation_id = -1;
  // Updates the stats.
  stats_.bytes_in_use -= c->size;
  - // This chunk is no longer in-use, consider coalescing the chunk
  - // with adjacent chunks.
  - ChunkHandle chunk_to_reassign = h;
  + ChunkHandle coalesced_chunk = h;
  - // If the next chunk is free, coalesce the two
  - if (c->next != kInvalidChunkHandle) {
  - Chunk* cnext = ChunkFromHandle(c->next);
  - if (!cnext->in_use()) {
  - // VLOG(8) << "Chunk at " << cnext->ptr << " merging with c " <<
  - // c->ptr;
  -
  - chunk_to_reassign = h;
  -
  - // Deletes c->next
  + // If the next chunk is free, merge it into c and delete it.
  + if (c->next != kInvalidChunkHandle && !ChunkFromHandle(c->next)->in_use()) {
  + // VLOG(8) << "Merging c->next " << ChunkFromHandle(c->next)->ptr
  + // << " with c " << c->ptr;
  RemoveFreeChunkFromBin(c->next);
  - Merge(h, ChunkFromHandle(h)->next);
  - }
  + Merge(h, c->next);
  }
  - // If the previous chunk is free, coalesce the two
  - c = ChunkFromHandle(h);
  - if (c->prev != kInvalidChunkHandle) {
  - Chunk* cprev = ChunkFromHandle(c->prev);
  - if (!cprev->in_use()) {
  - // VLOG(8) << "Chunk at " << c->ptr << " merging into c->prev "
  - // << cprev->ptr;
  + // If the previous chunk is free, merge c into it and delete c.
  + if (c->prev != kInvalidChunkHandle && !ChunkFromHandle(c->prev)->in_use()) {
  + // VLOG(8) << "Merging c " << c->ptr << " into c->prev "
  + // << ChunkFromHandle(c->prev)->ptr;
  - chunk_to_reassign = c->prev;
  -
  - // Deletes c
  + coalesced_chunk = c->prev;
  RemoveFreeChunkFromBin(c->prev);
  - Merge(ChunkFromHandle(h)->prev, h);
  - c = ChunkFromHandle(h);
  - }
  + Merge(c->prev, h);
  }
  - InsertFreeChunkIntoBin(chunk_to_reassign);
  + InsertFreeChunkIntoBin(coalesced_chunk);
  }
  void BFCAllocator::AddAllocVisitor(Visitor visitor) {
  