STL Memory Versioning
Functions
revision.cpp File Reference
#include "revision.h"
#include "versioned.h"
#include "segment.h"
#include <sstream>
Include dependency graph for revision.cpp:

Go to the source code of this file.

Functions

void PrintRevision (std::shared_ptr< Revision > revision)
 Print revision segments for debugging. More...
 

Function Documentation

◆ PrintRevision()

void PrintRevision ( std::shared_ptr< Revision revision)

Print revision segments for debugging.

Definition at line 19 of file revision.cpp.

19  {
20  if (revision == nullptr) {
21  std::cout << "Revision is null" << std::endl;
22  return;
23  }
24 
25  std::shared_ptr<Segment> s = revision->current;
26 
27  std::ostringstream o;
28  o << std::endl;
29  while (s) {
30  o << "thread: "<< std::this_thread::get_id() << ", segment ver:" << s->version
31  << ", addr: " << s << ", refcount: " << s->refcount << ", written size: " << s->written.size() << std::endl;
32  s = s->parent;
33  }
34 
35  std::cout << o.str() << std::endl;
36 }