onnxruntime
7d3b4d93 - Correct the overstated exception-free claim in ReadEpContextData (#31195)

Commit
65 days ago
Correct the overstated exception-free claim in ReadEpContextData (#31195) ### Description Addresses a review nit from @edgchen1 on #29294: the comment on `ReadEpContextData` claimed that using the C allocator API keeps the function `exception-free`. Using the C API instead of `Ort::AllocatorWithDefaultOptions` does keep an allocator failure on the `OrtStatus*` return path rather than throwing, so the intent was right. But it does not make the function no-throw: `std::filesystem::path`, `std::string` and the stream operations elsewhere in these helpers can still throw, and getting an actual guarantee would need try/catch that is not worth the complexity here. Reworded to describe the error-reporting style it really provides, and to state the limit explicitly, so a reader does not rely on a guarantee that is not there. While in the file, the same claim is dropped from two buffer-deleter comments and from `FreeAllocatorBuffer`, where the real reason not to throw is that the function is `noexcept`. Also fixes a stale reference to `the std::vector overload empty-on-failure guarantee`, since those read overloads were removed in #29294. ### Motivation and Context This file is sample/reference code that EP authors are expected to copy and adapt, so a comment promising a stronger guarantee than the code delivers is worth correcting. Filed separately so that #29294, which was already approved when the nit came in, did not need another review round and a full CI cycle for a comment-only change. #29294 has since merged and this is now rebased onto main. Comment only; no behavior change. `clang-format` clean, within 120 columns, and `onnxruntime_autoep_test` builds. Co-authored-by: Gopalakrishnan Nallasamy <gopalakrishnan.nallasamy@microsoft.com>
Parents
Loading