diff --git a/src/Qir/Runtime/lib/QIR/bridge-rt.ll b/src/Qir/Runtime/lib/QIR/bridge-rt.ll index c328a845edf..6bf2efe9cbd 100644 --- a/src/Qir/Runtime/lib/QIR/bridge-rt.ll +++ b/src/Qir/Runtime/lib/QIR/bridge-rt.ll @@ -37,8 +37,6 @@ ;------------------------------------------------------------------------------ ; classical ; -declare i8* @quantum__rt__heap_alloc(i64) -declare void @quantum__rt__heap_free(i8*) declare i8* @quantum__rt__memory_allocate(i64) declare void @quantum__rt__fail(%"struct.QirString"*) @@ -121,15 +119,6 @@ declare void @quantum__rt__message(%"struct.QirString"* %str) ;------------------------------------------------------------------------------ ; classical bridge ; -define dllexport i8* @__quantum__rt__heap_alloc(i64 %size) { - %mem = call i8* @quantum__rt__heap_alloc(i64 %size) - ret i8* %mem -} - -define dllexport void @__quantum__rt__heap_free(i8* %mem) { - call void @quantum__rt__heap_free(i8* %mem) - ret void -} ; Returns a pointer to the malloc-allocated block. define dllexport i8* @__quantum__rt__memory_allocate(i64 %size) { diff --git a/src/Qir/Runtime/lib/QIR/utils.cpp b/src/Qir/Runtime/lib/QIR/utils.cpp index 0110fd77fd0..9fd473c2d3a 100644 --- a/src/Qir/Runtime/lib/QIR/utils.cpp +++ b/src/Qir/Runtime/lib/QIR/utils.cpp @@ -13,39 +13,9 @@ #include "QirRuntime.hpp" #include "OutputStream.hpp" -static std::unordered_set& UseMemoryTracker() -{ - static std::unordered_set memoryTracker; - return memoryTracker; -} extern "C" { - // Allocate a block of memory on the heap. - char* quantum__rt__heap_alloc(uint64_t size) // NOLINT - { - char* buffer = new (std::nothrow) char[size]; - if(buffer == nullptr) - { - quantum__rt__fail(quantum__rt__string_create("Allocation Failed")); - } - #ifndef NDEBUG - UseMemoryTracker().insert(buffer); - #endif - return buffer; - } - - // Release a block of allocated heap memory. - void quantum__rt__heap_free(char* buffer) // NOLINT - { - #ifndef NDEBUG - auto iter = UseMemoryTracker().find(buffer); - assert(iter != UseMemoryTracker().end()); - UseMemoryTracker().erase(iter); - #endif - delete[] buffer; - } - char* quantum__rt__memory_allocate(uint64_t size) { return (char *)malloc((size_t)size);