Skip to content

Commit 9249e12

Browse files
committed
Zero-initialize memory pool buffers
1 parent 2570595 commit 9249e12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Support/MemoryManagement.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,10 @@ double *MemoryPool::get(uint64_t id) const {
204204

205205
uint64_t MemoryPool::create(size_t numOfElements) {
206206
uint64_t id = buffers.size();
207+
207208
buffers.push_back(
208-
static_cast<double *>(std::malloc(sizeof(double) * numOfElements)));
209+
static_cast<double *>(std::calloc(numOfElements, sizeof(double))));
210+
209211
return id;
210212
}
211213

0 commit comments

Comments
 (0)