If my measurements are right, WAYYYY better now. Missed a huge memory leak, now like 0.34147GB, I think

This commit is contained in:
Nathan Braswell
2015-03-23 15:52:25 -04:00
parent 6fa06f2b7e
commit b01078e7a0
2 changed files with 7 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ path_part = forward_slash alphanumeric | back_slash alphanumeric ;
forward_slash = "/" ; forward_slash = "/" ;
back_slash = "\\" ; back_slash = "\\" ;
# all for optional semicolons k # all for optional semicolons k k
line_break = " line_break = "
+" ; +" ;
actual_white = "( | )+" | line_break | line_break actual_white | "( | )+" actual_white ; actual_white = "( | )+" | line_break | line_break actual_white | "( | )+" actual_white ;

View File

@@ -286,7 +286,9 @@ void Parser::closure(State* state) {
state->remaining.push_back(currentGramRule); state->remaining.push_back(currentGramRule);
stateTotal = state->getTotal(); stateTotal = state->getTotal();
} }
} } else {
delete currentGramRule;
}
} }
} }
//std::cout << state->toString() << std::endl; //std::cout << state->toString() << std::endl;
@@ -322,7 +324,9 @@ void Parser::addStates(std::vector< State* >* stateSets, State* state, std::queu
State* newState = new State(stateSets->size()+newStates.size(),advancedRule, state); State* newState = new State(stateSets->size()+newStates.size(),advancedRule, state);
newStates.push_back(newState); newStates.push_back(newState);
} }
} } else {
delete advancedRule;
}
//Also add any completed rules as reduces in the action table //Also add any completed rules as reduces in the action table
//See if reduce //See if reduce
//Also, this really only needs to be done for the state's basis, but we're already iterating through, so... //Also, this really only needs to be done for the state's basis, but we're already iterating through, so...