summaryrefslogtreecommitdiff
path: root/libartbase/base/allocator.h
diff options
context:
space:
mode:
author Stefano Cianciulli <scianciulli@google.com> 2023-05-16 10:32:54 +0000
committer Stefano Cianciulli <scianciulli@google.com> 2023-05-22 10:36:39 +0000
commit78f3c72e8948087352788997a70854dee613352c (patch)
tree306db3c15bc4b7af149bcf3e07be533e50679b88 /libartbase/base/allocator.h
parentdc771261232c2ff702373f396a5a7fe586e2f0a6 (diff)
Use C++17's [[maybe_unused]] attribute in ART
Bug: 169680875 Test: mmm art Change-Id: Ic0cc320891c42b07a2b5520a584d2b62052e7235
Diffstat (limited to 'libartbase/base/allocator.h')
-rw-r--r--libartbase/base/allocator.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libartbase/base/allocator.h b/libartbase/base/allocator.h
index 81f3a60815..24374a2b40 100644
--- a/libartbase/base/allocator.h
+++ b/libartbase/base/allocator.h
@@ -115,8 +115,8 @@ class TrackingAllocatorImpl : public std::allocator<T> {
// Used internally by STL data structures.
template <class U>
- TrackingAllocatorImpl(
- const TrackingAllocatorImpl<U, kTag>& alloc ATTRIBUTE_UNUSED) noexcept {}
+ explicit TrackingAllocatorImpl(
+ [[maybe_unused]] const TrackingAllocatorImpl<U, kTag>& alloc) noexcept {}
// Used internally by STL data structures.
TrackingAllocatorImpl() noexcept {
@@ -130,7 +130,7 @@ class TrackingAllocatorImpl : public std::allocator<T> {
using other = TrackingAllocatorImpl<U, kTag>;
};
- pointer allocate(size_type n, const_pointer hint ATTRIBUTE_UNUSED = 0) {
+ pointer allocate(size_type n, [[maybe_unused]] const_pointer hint = 0) {
const size_t size = n * sizeof(T);
TrackedAllocators::RegisterAllocation(GetTag(), size);
return reinterpret_cast<pointer>(malloc(size));