Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2017-02-15 13:22:10 +0300
committerHieu Hoang <hieuhoang@gmail.com>2017-02-15 13:22:10 +0300
commitf8f4087aac52a5686f2a5c7a498daba670919165 (patch)
tree469a7def208ff60d5dc69334803d3192efefc765 /moses2/TranslationModel
parent75a736964819fc77a72ac360d7ae5a46f76bbaf5 (diff)
change new -> alloca
Diffstat (limited to 'moses2/TranslationModel')
-rw-r--r--moses2/TranslationModel/ProbingPT/ProbingPT.cpp6
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]));
}