Skip to content

Commit

Permalink
Merge pull request #1336 from undingen/llvm_free_object_files
Browse files Browse the repository at this point in the history
MCJIT: free loaded objects
  • Loading branch information
undingen authored Aug 22, 2016
2 parents 0324606 + a36654a commit 76c7d50
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions llvm_patches/0013-MCJIT-free-loaded-objects.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 1296ca8841c3725043d49eff5b589805f95129b3 Mon Sep 17 00:00:00 2001
From: Marius Wachtler <undingen@gmail.com>
Date: Mon, 22 Aug 2016 14:34:40 +0100
Subject: [PATCH] MCJIT: free loaded objects

---
lib/ExecutionEngine/MCJIT/MCJIT.cpp | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index e500d3d..17d2145 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -223,6 +223,12 @@ void MCJIT::finalizeLoadedModules() {

// Set page permissions.
MemMgr.finalizeMemory();
+
+ // Pyston change: free loaded objects
+ for (auto &Obj : LoadedObjects)
+ if (Obj)
+ NotifyFreeingObject(*Obj);
+ LoadedObjects.clear();
}

// FIXME: Rename this.
--
1.9.1

0 comments on commit 76c7d50

Please sign in to comment.