forked from OSchip/llvm-project
[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:
parent
c173c04b12
commit
349e5bd24e
|
@ -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)) {
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue