HCoop
/
clinton
/
Smoothieware.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
846b53f
)
reallocate the gcode vector in block to reduce memory usage when block is cleared
author
Jim Morris
<morris@wolfman.com>
Thu, 19 Jun 2014 06:30:28 +0000
(23:30 -0700)
committer
Jim Morris
<morris@wolfman.com>
Thu, 19 Jun 2014 06:30:28 +0000
(23:30 -0700)
src/modules/robot/Block.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/modules/robot/Block.cpp
b/src/modules/robot/Block.cpp
index
c133e1e
..
b4497d8
100644
(file)
--- a/
src/modules/robot/Block.cpp
+++ b/
src/modules/robot/Block.cpp
@@
-37,6
+37,8
@@
void Block::clear()
//commands.clear();
//travel_distances.clear();
gcodes.clear();
+ std::vector<Gcode>().swap(gcodes); // this resizes the vector releasing its memory
+
clear_vector(this->steps);
steps_event_count = 0;