Add new operators that work with CompAllocator
authorMike Danes <onemihaid@hotmail.com>
Sat, 14 Oct 2017 11:00:14 +0000 (14:00 +0300)
committerMike Danes <onemihaid@hotmail.com>
Sun, 15 Oct 2017 10:29:46 +0000 (13:29 +0300)
src/jit/jit.h

index 93c4b21..a395756 100644 (file)
@@ -860,6 +860,18 @@ public:
     }
 };
 
+// Global operator new overloads that work with CompAllocator
+
+inline void* __cdecl operator new(size_t n, CompAllocator* alloc)
+{
+    return alloc->Alloc(n);
+}
+
+inline void* __cdecl operator new[](size_t n, CompAllocator* alloc)
+{
+    return alloc->Alloc(n);
+}
+
 class JitTls
 {
 #ifdef DEBUG