Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Use proper heap for stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
mskvortsov committed Dec 13, 2016
1 parent f9b5b4c commit 1a344af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion src/vm/interpreter.cpp
Expand Up @@ -1579,7 +1579,7 @@ CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp,
#else
#error unsupported platform
#endif
stub = sl.Link();
stub = sl.Link(SystemDomain::GetGlobalLoaderAllocator()->GetStubHeap());

*nativeSizeOfCode = static_cast<ULONG>(stub->GetNumCodeBytes());
// TODO: manage reference count of interpreter stubs. Look for examples...
Expand Down
12 changes: 0 additions & 12 deletions src/vm/stublink.cpp
Expand Up @@ -2139,10 +2139,6 @@ Stub* Stub::NewStub(PTR_VOID pCode, DWORD flags)
return pStub;
}

#if defined(PLATFORM_UNIX) && defined(_ARM_)
extern "C" int mprotect(void *addr, size_t len, int prot);
#endif

//-------------------------------------------------------------------
// Stub allocation done here.
//-------------------------------------------------------------------
Expand Down Expand Up @@ -2205,14 +2201,6 @@ extern "C" int mprotect(void *addr, size_t len, int prot);
pBlock = new (executable) BYTE[totalSize];
#else
pBlock = new BYTE[totalSize];
#if defined(PLATFORM_UNIX) && defined(_ARM_)
_ASSERTE(totalSize <= 0x1000);
unsigned addr = (unsigned)pBlock;
unsigned size = 0x1000;
if ((addr & 0xfff) + totalSize > 0x1000)
size += 0x1000;
mprotect((void*)(addr & 0xfffff000), size, 7);
#endif
#endif
}
else
Expand Down

0 comments on commit 1a344af

Please sign in to comment.