influxdata / flux

Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.
https://influxdata.com
MIT License
760 stars 152 forks source link

feat: return to internal string references #5486

Closed mhilton closed 4 weeks ago

mhilton commented 4 weeks ago

Undo the main change introduced in #5377 so that by default strings returned from array.Strings use the internal memory of the stored data. This means that it is more likely that there are some cases of use-after-free errors in the flux executor, the trade-off being that there is less likely to be a proliferation of memory allocation due to string copying. Overall use-after-free errors will not cause incorrect results with regard to strings as they are read only and the Go runtime will only free the memory once the garbage collector has determined it is unused.

Checklist

Dear Author :wave:, the following checks should be completed (or explicitly dismissed) before merging.

Dear Reviewer(s) :wave:, you are responsible (among others) for ensuring the completeness and quality of the above before approval.