diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2017-02-15 13:22:10 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2017-02-15 13:22:10 +0300 |
commit | f8f4087aac52a5686f2a5c7a498daba670919165 (patch) | |
tree | 469a7def208ff60d5dc69334803d3192efefc765 /moses2/TranslationModel | |
parent | 75a736964819fc77a72ac360d7ae5a46f76bbaf5 (diff) |
change new -> alloca
Diffstat (limited to 'moses2/TranslationModel')
-rw-r--r-- | moses2/TranslationModel/ProbingPT/ProbingPT.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/moses2/TranslationModel/ProbingPT/ProbingPT.cpp b/moses2/TranslationModel/ProbingPT/ProbingPT.cpp index 86231842d..852f0a7b7 100644 --- a/moses2/TranslationModel/ProbingPT/ProbingPT.cpp +++ b/moses2/TranslationModel/ProbingPT/ProbingPT.cpp @@ -240,7 +240,7 @@ std::pair<bool, uint64_t> ProbingPT::GetKey(const Phrase<Moses2::Word> &sourcePh size_t sourceSize = sourcePhrase.GetSize(); assert(sourceSize); - uint64_t *probingSource = new uint64_t[sourceSize]; + uint64_t *probingSource = (uint64_t*) alloca(sourceSize * sizeof(uint64_t)); GetSourceProbingIds(sourcePhrase, ret.first, probingSource); if (!ret.first) { // source phrase contains a word unknown in the pt. @@ -317,7 +317,7 @@ TargetPhraseImpl *ProbingPT::CreateTargetPhrase( } } else { // log score 1st - SCORE *logScores = new SCORE[totalNumScores]; + SCORE *logScores = (SCORE*) alloca(totalNumScores * sizeof(SCORE)); for (size_t i = 0; i < totalNumScores; ++i) { logScores[i] = FloorScore(TransformScore(scores[i])); } @@ -622,7 +622,7 @@ SCFG::TargetPhraseImpl *ProbingPT::CreateTargetPhraseSCFG( } } else { // log score 1st - SCORE *logScores = new SCORE[totalNumScores]; + SCORE *logScores = (SCORE*) alloca(totalNumScores * sizeof(SCORE)); for (size_t i = 0; i < totalNumScores; ++i) { logScores[i] = FloorScore(TransformScore(scores[i])); } |