Skip to content

Commit f2cee19

Browse files
committed
HeapArray: Add size_bytes()
1 parent 2624914 commit f2cee19

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/common/heap_array.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class FixedHeapArray
4040
~FixedHeapArray() { deallocate(); }
4141

4242
size_type size() const { return SIZE; }
43+
size_type size_bytes() const { return SIZE * sizeof(T); }
4344
size_type capacity() const { return SIZE; }
4445
bool empty() const { return false; }
4546

@@ -234,6 +235,7 @@ class DynamicHeapArray
234235
~DynamicHeapArray() { internal_deallocate(); }
235236

236237
size_type size() const { return m_size; }
238+
size_type size_bytes() const { return m_size * sizeof(T); }
237239
size_type capacity() const { return m_size; }
238240
bool empty() const { return (m_size == 0); }
239241

0 commit comments

Comments
 (0)