diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-hash.h | 9 | ||||
| -rw-r--r-- | source/core/slang-memory-arena.h | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/core/slang-hash.h b/source/core/slang-hash.h index 248d11303..8c4fbac42 100644 --- a/source/core/slang-hash.h +++ b/source/core/slang-hash.h @@ -177,6 +177,15 @@ namespace Slang return h; } + inline HashCode combineHash(HashCode hash0, HashCode hash1, HashCode hash2, HashCode hash3) + { + auto h = hash0; + h = combineHash(h, hash1); + h = combineHash(h, hash2); + h = combineHash(h, hash3); + return h; + } + struct Hasher { public: diff --git a/source/core/slang-memory-arena.h b/source/core/slang-memory-arena.h index 75f3faac3..4d2372e44 100644 --- a/source/core/slang-memory-arena.h +++ b/source/core/slang-memory-arena.h @@ -440,4 +440,15 @@ SLANG_FORCE_INLINE void MemoryArena::rewindToCursor(const void* cursor) } // namespace Slang +SLANG_FORCE_INLINE void* operator new(size_t size, Slang::MemoryArena& arena) +{ + return arena.allocate(size); +} + +SLANG_FORCE_INLINE void operator delete(void* memory, Slang::MemoryArena& arena) +{ + SLANG_UNUSED(memory); + SLANG_UNUSED(arena); +} + #endif // SLANG_MEMORY_ARENA_H |
