summaryrefslogtreecommitdiff
path: root/source/core/slang-memory-arena.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-memory-arena.cpp')
-rw-r--r--source/core/slang-memory-arena.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/core/slang-memory-arena.cpp b/source/core/slang-memory-arena.cpp
index 4d8b2ed2a..a0a89155c 100644
--- a/source/core/slang-memory-arena.cpp
+++ b/source/core/slang-memory-arena.cpp
@@ -222,6 +222,16 @@ MemoryArena::Block* MemoryArena::_newBlock(size_t allocSize, size_t alignment)
return block;
}
+void* MemoryArena::_allocateAlignedFromNewBlockAndZero(size_t sizeInBytes, size_t alignment)
+{
+ void* mem = _allocateAlignedFromNewBlock(sizeInBytes, alignment);
+ if (mem)
+ {
+ ::memset(mem, 0, sizeInBytes);
+ }
+ return mem;
+}
+
void* MemoryArena::_allocateAlignedFromNewBlock(size_t size, size_t alignment)
{
// Make sure init has been called (or has been set up in parameterized constructor)