[ORC] Update mapper deinitialize functions to deinitialize in reverse order.

This updates the ExecutorSharedMemoryMapperService::deinitialize and
InProcessMemoryMapper::deinitialize methods to deinitialize in reverse order,
bringing them into alignment with the behavior of
InProcessMemoryManager::deallocate and SimpleExecutorMemoryManager::deallocate.
Reverse deinitialization is required because later allocations can depend on
earlier ones.

This fixes failures in the ORC runtime test suite.
This commit is contained in:
Lang Hames 2022-08-30 13:08:22 -07:00
parent c173c04b12
commit 349e5bd24e
2 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ void InProcessMemoryMapper::deinitialize(
{
std::lock_guard<std::mutex> Lock(Mutex);
for (auto Base : Bases) {
for (auto Base : llvm::reverse(Bases)) {
if (Error Err = shared::runDeallocActions(
Allocations[Base].DeinitializationActions)) {

View File

@ -192,7 +192,7 @@ Error ExecutorSharedMemoryMapperService::deinitialize(
{
std::lock_guard<std::mutex> Lock(Mutex);
for (auto Base : Bases) {
for (auto Base : llvm::reverse(Bases)) {
if (Error Err = shared::runDeallocActions(
Allocations[Base].DeinitializationActions)) {
AllErr = joinErrors(std::move(AllErr), std::move(Err));