File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -395,8 +395,8 @@ class DistinctAttributeUniquer {
395395};
396396
397397// / An allocator for distinct attribute storage instances. Uses a synchronized
398- // / BumpPtrAllocator to ensure allocated storage is deleted when the
399- // / DistinctAttributeAllocator is destroyed
398+ // / BumpPtrAllocator to ensure thread-safety. The allocated storage is deleted
399+ // / when the DistinctAttributeAllocator is destroyed.
400400class DistinctAttributeAllocator final {
401401public:
402402 DistinctAttributeAllocator () = default ;
@@ -412,11 +412,11 @@ class DistinctAttributeAllocator final {
412412 };
413413
414414private:
415- // / Used to allocate Distict Attribute storage. When this allocator destroyed
416- // / in till also dealllocate any storage instances
415+ // / Used to allocate Distict Attribute storages. The managed memory is freed
416+ // / automatically when the allocator instance is destroyed.
417417 llvm::BumpPtrAllocator allocator;
418418
419- // / Used to lock access to the allocator
419+ // / Used to lock access to the allocator.
420420 std::mutex allocatorMutex;
421421};
422422} // namespace detail
Original file line number Diff line number Diff line change 1- // ===- DistinctAttributeAllocatorTest.cpp - DistinctAttr storage alloc test
2- // -===//
1+ // === DistinctAttributeAllocatorTest.cpp - DistinctAttr storage alloc test ===//
32//
43// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
54// See https://llvm.org/LICENSE.txt for license information.
65// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
76//
8- // ===----------------------------------------------------------------------- ===//
7+ // ===----------------------------------------------------------------------===//
98
109#include " gtest/gtest.h"
1110
@@ -19,7 +18,7 @@ using namespace mlir;
1918
2019//
2120// Test that a DistinctAttr that is created on a separate thread does
22- // not have its storage deleted when the thread joins
21+ // not have its storage deleted when the thread joins.
2322//
2423TEST (DistinctAttributeAllocatorTest, TestAttributeWellFormedAfterThreadJoin) {
2524 MLIRContext ctx;
You can’t perform that action at this time.
0 commit comments