platform_hardware_interfaces/neuralnetworks/1.3/utils
Michael Butler ad643b608c Move NN_TRY macro out of struct initialization
NNAPI NN_TRY macros use Statement Expressions (a GNU extension) to
propagate errors. However, a "return" statement in a Statement
Expression can lead to memory leaks when the Statement Expression is
being used to initialize a member of a struct. Specifically, when one
member of a struct is already initialized, and a Statement Expression
used to initialize a subsequent member early-returns, the previously
initialized members will not have their destructors called.

This CL moves any NN_TRY macro out of struct initialization to avoid any
potential memory leaks.

Bug: 230500484
Test: mma
Test: presubmit
Change-Id: I3493fd4764f8eacc86750e6414e62bc891abaccd
Merged-In: I3493fd4764f8eacc86750e6414e62bc891abaccd
2022-04-29 14:32:10 -07:00
..
include/nnapi/hal/1.3 HAL interface for compilation and execution hints 2022-01-20 16:48:40 +00:00
src Move NN_TRY macro out of struct initialization 2022-04-29 14:32:10 -07:00
test HAL interface for compilation and execution hints 2022-01-20 16:48:40 +00:00
Android.bp Merge "Remove NN host specific build defines" 2022-02-24 00:59:51 +00:00