onnxruntime
76952334 - Add version check for IAlloactor::GetStats (#24989)

Commit
194 days ago
Add version check for IAlloactor::GetStats (#24989) ### Description <!-- Describe your changes. --> Add version check for IAlloactor::GetStats and IAllocatorImplWrappingOrtAllocator::GetStats. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> The ORT API maintains ABI and backward compatibility, allowing applications built with an older version to run with a newer one. However, when a user calls RegisterAllocator with a custom allocator, any new function pointers introduced in the newer version may contain invalid (garbage) values, as the older application is unaware of them. To address this, this PR adds version checks in OrtAllocatorImplWrappingIAllocator and IAllocatorImplWrappingOrtAllocator to ensure safe and compatible behavior when interfacing with potentially newer ORT structures.
Author
Parents
Loading