On Mon, Mar 15, 2021 at 5:05 PM Stephen R. van den Berg srb@cuci.nl wrote:
It seems to be a valid use case, since I provide the iov array and the source of the strings. The source will stay put while the write method runs, and I'll take care of freeing the source myself after the pop_stack(). So, yes, the only thing I need is some window dressing so that the string can be accessed from the Pike stack, and supposedly can be freed there, which should not touch the strings itself.
This would need so much more than just window-dressing. You're asking for trouble. The GC might decide to run, I wouldn't necessarily expect that to work out - but then maybe it does, another thread might request a backtrace of your thread and non-hashed strings might leak into the system like that, or your write call might fail (say OOM), leaving your very own thread with a backtrace leaking the non-hashed string into the system.