emacs-devel
[Top][All Lists]
Advanced

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

Re: transpose-regions


From: Stefan Monnier
Subject: Re: transpose-regions
Date: Fri, 23 Mar 2007 12:42:00 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

>> I'm running on GNU/Linux with the latest CVS.
> Which uses conservative stack marking too.
> So it's definitely not "just" a missing GC pro somewhere.

I think I see the problem: intervals are not Lisp objects and thus they are
not detected by the conservative stack scanning (and they can't be GCPRO'd
either).

I.e. make_interval does:

     ...
     newi = (struct interval_block *) lisp_malloc (sizeof *newi,
                                                   MEM_TYPE_NON_LISP);
     ...

while mark_maybe_pointer does:

      ...
      switch (m->type)
        {
        case MEM_TYPE_NON_LISP:
          /* Nothing to do; not a pointer to Lisp memory.  */
          break;
      ...

and m->type can probably never be MEM_TYPE_NON_LISP anyway, because
lisp_malloc does:

    ...
    if (val && type != MEM_TYPE_NON_LISP)
      mem_insert (val, (char *) val + nbytes, type);
    ...


so after the copy_intervals, if Fset_text_properties ends up calling the
garbage collector (probably via some after-change-function) you're hosed.

Personally, I think the best solution is to rewrite transpose-regions in
Lisp.  After all, it's only called from gnus/deuglify.el and from
games/hanoi.el (and interactively as well, of course).


        Stefan




reply via email to

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