Gunnar Evermann <ge204(a)eng.cam.ac.uk> writes:
> That's no lie. buffer_insert_string_1() can not only GC,
but
> invoke arbitrary Lisp code! Remember
> {before,after}-change-functions.
I know. Maybe I misunderstood all those 'can GC'-comments. I assumed
them to mean:
- during execution of this functions Lisp code might be called and
potentially GC can occur
Yes.
- this code is GC-safe, meaning it GCPROs all local Lisp_Objects
and therefore a GC won't collect vital stuff.
No, I don't think "this function can GC" means that. David Moore's
"GC checked <date here>" might mean that, but the way I see it,
vanilla "this function can GC" simply means "if you call this
function, be prepared that a GC might happen".
My question was basically why we don't GCPRO 'str' and
then use
RETURN_GCPRO, to ensure the second point.
Dunno. Hysterical reasons, probably. We should probably check how
buffer_insert_string_1() can be called and make all the callers
properly GC-protect RELOC.