Skip to content
Snippets Groups Projects
Commit fa20a617 authored by Petr Zejdl's avatar Petr Zejdl
Browse files

Slice variables are reset when slice is reaused

parent da7398f4
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ Slice *Slice::getAllocated() { ...@@ -30,6 +30,7 @@ Slice *Slice::getAllocated() {
Slice::free_slices.pop(t); Slice::free_slices.pop(t);
// fprintf(stderr,"successfully popped, current size // fprintf(stderr,"successfully popped, current size
// %d\n",free_slices.size()); // %d\n",free_slices.size());
t->reset();
return t; return t;
} }
......
...@@ -40,6 +40,13 @@ class Slice { ...@@ -40,6 +40,13 @@ class Slice {
static size_t current_queue_size(); static size_t current_queue_size();
Slice *clone() const { return new Slice(*this); } Slice *clone() const { return new Slice(*this); }
void reset() {
logical_end = begin();
counts = 0;
output = false;
firstOrbitN = 0;
}
//! Free a Slice object //! Free a Slice object
void free() { void free() {
// fprintf(stderr,"slice free at 0x%llx \n",(unsigned long long) this); // fprintf(stderr,"slice free at 0x%llx \n",(unsigned long long) this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment