-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1336 from undingen/llvm_free_object_files
MCJIT: free loaded objects
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|