Ensure that BO handle is closed only once

When one process had exported and then opened IPC handle
of memory, then close function was called twice for the
same BO handle. It caused debugBreak() and aborted
an application.

This change allows multiple separate BOs to share one
handle. The last shared handle owner calls close() function.

Related-To: NEO-7200
Signed-off-by: Wrobel, Patryk <patryk.wrobel@intel.com>
This commit is contained in:
Wrobel, Patryk
2023-02-01 15:58:22 +00:00
committed by Compute-Runtime-Automation
parent 272427bb1c
commit 4c58eda90d
12 changed files with 488 additions and 41 deletions

View File

@@ -196,6 +196,8 @@ class MemoryManager {
return nullptr;
}
virtual void registerIpcExportedAllocation(GraphicsAllocation *graphicsAllocation) {}
MOCKABLE_VIRTUAL void *alignedMallocWrapper(size_t bytes, size_t alignment);
MOCKABLE_VIRTUAL void alignedFreeWrapper(void *ptr);
@@ -348,4 +350,4 @@ class MemoryManager {
};
std::unique_ptr<DeferredDeleter> createDeferredDeleter();
} // namespace NEO
} // namespace NEO