diff --git a/src/slice.cc b/src/slice.cc index b10cf601ebdcac34609cb54b1a8b07fc139d31d3..cf590b05cfe34921b3b3b5f481c5aefc8f52d4c5 100644 --- a/src/slice.cc +++ b/src/slice.cc @@ -30,6 +30,7 @@ Slice *Slice::getAllocated() { Slice::free_slices.pop(t); // fprintf(stderr,"successfully popped, current size // %d\n",free_slices.size()); + t->reset(); return t; } diff --git a/src/slice.h b/src/slice.h index 72770a9ccdc94a4053cf7a3b48d1c25e0833f04a..e54aae976c3ffb68c73aa7b8c959048eb4152ed8 100644 --- a/src/slice.h +++ b/src/slice.h @@ -40,6 +40,13 @@ public: static size_t current_queue_size(); Slice *clone() const { return new Slice(*this); } + void reset() { + logical_end = begin(); + counts = 0; + output = false; + firstOrbitN = 0; + } + //! Free a Slice object void free() { // fprintf(stderr,"slice free at 0x%llx \n",(unsigned long long) this);