| Message ID | 20260922155035.235817-1-barnabas.pocze@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Barnabás Pőcze (2026-09-22 16:50:34) > Return the reference directly that is returned by the interpolator. > The interpolator is generating a new table I expect. Who owns that memory and keeps it alive to be able to use a reference? I can see the implementation itself seems to return a reference though: src/ipa/libipa/interpolator.h: const T &getInterpolated(unsigned int key) Aha, there is storage in the interpolator T lastInterpolatedValue_; So we're returning a reference to that. In this scenario I think that's fine. No one should be calling getInterpolated multiple times with different values and expecting to use both sets. But it might be something to keep in mind, that successive calls to the interpolator would operate on the same memory. That's already the case for the interpolator, and this is just improving the efficiency of the lsc handling, which looks good to me so: Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > --- > src/ipa/libipa/lsc.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/ipa/libipa/lsc.h b/src/ipa/libipa/lsc.h > index 17d5a4a141..ad378cc6ce 100644 > --- a/src/ipa/libipa/lsc.h > +++ b/src/ipa/libipa/lsc.h > @@ -118,7 +118,7 @@ public: > return 0; > } > > - const Components interpolateComponents(unsigned int ct) > + const Components &interpolateComponents(unsigned int ct) > { > return sets_.getInterpolated(ct); > } > -- > 2.55.0 >
diff --git a/src/ipa/libipa/lsc.h b/src/ipa/libipa/lsc.h index 17d5a4a141..ad378cc6ce 100644 --- a/src/ipa/libipa/lsc.h +++ b/src/ipa/libipa/lsc.h @@ -118,7 +118,7 @@ public: return 0; } - const Components interpolateComponents(unsigned int ct) + const Components &interpolateComponents(unsigned int ct) { return sets_.getInterpolated(ct); }
Return the reference directly that is returned by the interpolator. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/lsc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)