emacs-devel
[Top][All Lists]
Advanced

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

I don't understand this comment on message2


From: Kim F. Storm
Subject: I don't understand this comment on message2
Date: Mon, 19 Sep 2005 10:30:56 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

I have studied the code in message2 and the functions called by it
quite a lot (hunting for GC-related errors), and I don't understand
the restrictions in the second paragraph of message2's commentary
(included below).

It is indeed not safe to pass data from a lisp string (due to
potential GC), but not for the reasons listed.  I cannot find any
place where the buffer M is stored for later reference.
So using alloca'ed memory seems safe to me.

Can anyone enlighten me?



/* Display an echo area message M with a specified length of NBYTES
   bytes.  The string may include null characters.  If M is 0, clear
   out any existing message, and let the mini-buffer text show
   through.

   The buffer M must continue to exist until after the echo area gets
   cleared or some other message gets displayed there.  This means do
   not pass text that is stored in a Lisp string; do not pass text in
   a buffer that was alloca'd.  */

void
message2 (m, nbytes, multibyte)

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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