diff --git a/src/checkpoint/container/queue_serialize.h b/src/checkpoint/container/queue_serialize.h index c47b2988..a81b0426 100644 --- a/src/checkpoint/container/queue_serialize.h +++ b/src/checkpoint/container/queue_serialize.h @@ -52,37 +52,18 @@ namespace checkpoint { template -void serialize(Serializer& s, std::queue q) { +void serialize(Serializer& s, const std::queue& q) { serializeQueue(s, q); } -template < - typename SerializerT, - typename T, - typename = std::enable_if_t< - std::is_same< - SerializerT, - checkpoint::Footprinter - >::value - > -> -void serializeQueue(SerializerT& s, std::queue q) { - s.countBytes(q); - while (not q.empty()) - { - s | q.front(); - q.pop(); - } -} - template -void serialize(Serializer& s, std::priority_queue q) { +void serialize(Serializer& s, const std::priority_queue& q) { serializeQueue(s, q); } template < typename SerializerT, - typename T, + typename Q, typename = std::enable_if_t< std::is_same< SerializerT, @@ -90,13 +71,9 @@ template < >::value > > -void serializeQueue(SerializerT& s, std::priority_queue q) { +void serializeQueue(SerializerT& s, const Q& q) { s.countBytes(q); - while (not q.empty()) - { - s | q.top(); - q.pop(); - } + s.contiguousBytes(nullptr, sizeof(typename Q::value_type), q.size()); } } /* end namespace checkpoint */ diff --git a/src/checkpoint/container/raw_ptr_serialize.h b/src/checkpoint/container/raw_ptr_serialize.h index c530eb2c..1729f2eb 100644 --- a/src/checkpoint/container/raw_ptr_serialize.h +++ b/src/checkpoint/container/raw_ptr_serialize.h @@ -83,8 +83,8 @@ void serializeRawPtr(SerializerT& s, T* ptr) { /** * \brief Serialize FILE pointer \c ptr * - * Only footprinting mode is supported at the moment. Counts the pointer and - * pointee (underlying struct) size without following it. + * Only footprinting mode is supported at the moment. Counts the pointer size + * without following it. * * \param[in] serializer serializer to use * \param[in] ptr pointer to serialize @@ -106,9 +106,6 @@ template < > void serializeFilePtr(SerializerT& s, FILE* ptr) { s.countBytes(ptr); - if (ptr != nullptr) { - s.countBytes(*ptr); - } } } /* end namespace checkpoint */ diff --git a/src/checkpoint/container/string_serialize.h b/src/checkpoint/container/string_serialize.h index 07c4beaf..801d0827 100644 --- a/src/checkpoint/container/string_serialize.h +++ b/src/checkpoint/container/string_serialize.h @@ -61,7 +61,7 @@ void serializeStringMeta(Serializer& s, std::string& str) { /** * \brief Serialize string \c str * - * Resizes a string to it's actual size and serializes it. + * Resizes a string to its actual size and serializes it. * Note: footprinting mode does not detect small string optimization, so * a limited overcount is possible. *