From: Jim Morris Date: Thu, 19 Jun 2014 06:30:28 +0000 (-0700) Subject: reallocate the gcode vector in block to reduce memory usage when block is cleared X-Git-Url: http://git.hcoop.net/clinton/Smoothieware.git/commitdiff_plain/b64cb3dd5eafb1ea66b842f636d26b1b2fe2c799 reallocate the gcode vector in block to reduce memory usage when block is cleared --- diff --git a/src/modules/robot/Block.cpp b/src/modules/robot/Block.cpp index c133e1ef..b4497d87 100644 --- 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().swap(gcodes); // this resizes the vector releasing its memory + clear_vector(this->steps); steps_event_count = 0;