Skip to content

Commit

Permalink
Merge pull request #18516 from JuliaLang/jn/cgmem-consistency
Browse files Browse the repository at this point in the history
non-x86: ensure cgmemmgr caches are consistent
  • Loading branch information
yuyichao authored Sep 15, 2016
2 parents 3074189 + 6f57c40 commit ad77c0e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/cgmemmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,12 @@ class ROAllocator {
virtual ~ROAllocator() {}
virtual void finalize()
{
if (exec) {
for (auto &alloc: allocations) {
sys::Memory::InvalidateInstructionCache(alloc.rt_addr,
alloc.sz);
}
for (auto &alloc: allocations) {
// ensure the mapped pages are consistent
sys::Memory::InvalidateInstructionCache(alloc.wr_addr,
alloc.sz);
sys::Memory::InvalidateInstructionCache(alloc.rt_addr,
alloc.sz);
}
completed.clear();
allocations.clear();
Expand Down

0 comments on commit ad77c0e

Please sign in to comment.