Skip to content

Commit

Permalink
#1950: utils: add (footprinting) serializer to circular buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Sep 14, 2022
1 parent 2992d57 commit 20037c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vt/utils/container/circular_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ struct CircularBuffer {
bool full() const { return numFree() == 0; }
int len() const { return size - 1 - numFree(); }

template <typename SerializerT>
void serialize(SerializerT& s) {
s | head_;
s | tail_;
s | elms_; // this is inefficient, but it's use is footprinting
}

private:
int head_ = 0;
int tail_ = 0;
Expand Down

0 comments on commit 20037c6

Please sign in to comment.