[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC, experimental] save_{excursion,restriction}

From: Stefan Monnier
Subject: Re: [RFC, experimental] save_{excursion,restriction}
Date: Tue, 24 Jul 2012 18:05:26 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

>> BTW, why use an extra `excursions' field rather than just use a new
>> Lisp_Object type for "struct excursion"?
>> I think that would be cleaner to either make them into
>> Lisp_Pseudovector or Lisp_Misc.
> 1) "excursion state" is not visible to Lisp programs and so not referenced
> via Lisp_Objects, it's just a service thing related to save-excursion
> primitive and buffer internals. Just like buffer text for the basic editing
> primitives.
> 2) Lisp_XXX things are designed to be managed by GC, and other use of them
> is suspicious and discouraged (embedding Lisp_Markers into struct excursion
> is the poor solution in the absence of better alternatives). But, the
> main purpose of this design is to avoid any dependency from GC to achieve
> the lowest possible overhead of save-excursion.

I think you'll be better off making it into a standard Lisp_Object such
as pseudovector or a Lisp_Misc.  The fact that they're only used on the
specpdl and hence managed via xmalloc+xfree shouldn't make them
that special.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]