Hi :)

On Wed 29 Apr 2020 22:22, Ludovic Courtès <l...@gnu.org> writes:

> As discussed on IRC, the patch below arranges so that subrs that take
> strings and pass them to syscall wrappers can avoid the
> malloc/free/dynwind overhead.  This gives a 10% speedup on a tight loop
> that calls these subrs:

Neat optimization.  Since it's internal, no problem from me.  My concern
is only about calcifying aspects of our C / GC interface in API.

> On IRC, Andy mentioned concerns that the SCM could disappear and thus,
> our the internal pointer returned by ‘scm_locale_string_data’ wouldn’t
> be enough to prevent the stringbuf from being GC’d.

I would suggest doing the whole optimization and being sure to do
scm_remember_upto_here_1 on the SCM value at use sites.

Andy

Reply via email to