unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Richard M. Stallman" <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: GC garbles menu items
Date: Thu, 22 Dec 2005 00:47:39 -0500	[thread overview]
Message-ID: <E1EpJIh-0006bG-JO@fencepost.gnu.org> (raw)
In-Reply-To: <87psnrmwm8.fsf@jurta.org> (message from Juri Linkov on Tue, 20 Dec 2005 23:54:07 +0200)

    Is it possible to prevent relocation of the strings in GC for the time
    while the menu is up?

There is no feature to stop GC from relocating strings.  Adding one
would be a much more radical and risky change.  I don't want to do
that now, and perhaps not later.

What would be easier to do is turn off GC while the menu is up.  There
is already a way to do that: call inhibit_garbage_collection.  Does this
patch fix it?

*** xmenu.c	21 Dec 2005 19:38:13 -0500	1.297
--- xmenu.c	22 Dec 2005 00:36:37 -0500	
***************
*** 3343,3348 ****
--- 3343,3350 ----
        return Qnil;
      }
  
+   inhibit_garbage_collection ();
+ 
  #ifdef HAVE_X_WINDOWS
    /* Adjust coordinates to relative to the outer (window manager) window.  */
    x += FRAME_OUTER_TO_INNER_DIFF_X (f);

You also wrote:

      I believe it is possible to solve
    this problem by preventing string relocation the same way as it is done
    for menu items where keyboard equivalents are displayed in the same menu
    item.  Such menu items are constructed by the following code in xmenu_show
    (and GC doesn't corrupt these menu items):

What it is doing is copying the strings to the stack.  Indeed, that
technique should work.

Note that the code in the C_ALLOCA case probably has the same kind of
bug that we are discussing, because it creates a Lisp string that
could be moved:

		  Lisp_Object spacer;
		  spacer = Fmake_string (make_number (gap), make_number (' '));
		  item_name = concat2 (item_name, spacer);
		  item_name = concat2 (item_name, descrip);
		  item_data = SDATA (item_name);

It probably doesn't matter, because probably nobody uses the C_ALLOCA
case any more.  I would expect that all those configurations have been
obsolete for years.  Anyway, my patch should fix that too.

  reply	other threads:[~2005-12-22  5:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3sltjuvd6.fsf@czkmt.remus.dti.ne.jp>
2005-11-27  3:28 ` tooltip can be displayed outside the screen Richard M. Stallman
2005-11-27  4:55   ` Tetsuo Tsukamoto
2005-11-27 22:34     ` Richard M. Stallman
2005-12-02 14:58       ` Jan D.
2005-12-02 18:33         ` Eli Zaretskii
2005-12-02 21:04           ` Juri Linkov
2005-12-03 14:21           ` Jan Djärv
2005-12-06  0:52             ` Juri Linkov
2005-12-12 10:25               ` Jan D.
2005-12-14  7:54                 ` Juri Linkov
2005-12-14 21:01                   ` Jan Djärv
2005-12-15  9:28                     ` Juri Linkov
2005-12-16  1:52                       ` Richard M. Stallman
2005-12-16  9:03                         ` Juri Linkov
2005-12-17  1:04                           ` Richard M. Stallman
2005-12-17 10:48                             ` GC garbles menu items (was: tooltip can be displayed outside the screen) Juri Linkov
2005-12-18  0:00                               ` Richard M. Stallman
2005-12-20 21:54                                 ` GC garbles menu items Juri Linkov
2005-12-22  5:47                                   ` Richard M. Stallman [this message]
2005-12-22 20:48                                     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1EpJIh-0006bG-JO@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).