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:
authorKenneth Heafield <github@kheafield.com>2013-01-24 16:07:46 +0400
committerKenneth Heafield <github@kheafield.com>2013-01-24 16:07:46 +0400
commit03b077364a39b367a125092418278e9f4240c35f (patch)
tree4b410417dfec95f5bb1bf3f8ad1c3aad870bb979 /util/scoped.cc
parent22bf1c77e9866f5010708b288a33957a24627481 (diff)
KenLM 31a6644 resizable probing hash table, build fixes
Diffstat (limited to 'util/scoped.cc')
-rw-r--r--util/scoped.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/scoped.cc b/util/scoped.cc
index e7066ee47..b6972f14b 100644
--- a/util/scoped.cc
+++ b/util/scoped.cc
@@ -16,6 +16,12 @@ void *MallocOrThrow(std::size_t requested) {
return ret;
}
+void *CallocOrThrow(std::size_t requested) {
+ void *ret;
+ UTIL_THROW_IF_ARG(!(ret = std::calloc(1, requested)), MallocException, (requested), "in calloc");
+ return ret;
+}
+
scoped_malloc::~scoped_malloc() {
std::free(p_);
}