Commit f291069a authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(message_dolog): Add warning about GC and Lisp strings.

(message2): Fix commentary.  Ok to use alloca'ed memory.
Still not ok to use Lisp string data (because of GC).
(set_message): Add comment why GC cannot happen.
parent 5db60f31
...@@ -6752,7 +6752,10 @@ message_log_maybe_newline () ...@@ -6752,7 +6752,10 @@ message_log_maybe_newline ()
terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if
nonzero, means interpret the contents of M as multibyte. This nonzero, means interpret the contents of M as multibyte. This
function calls low-level routines in order to bypass text property function calls low-level routines in order to bypass text property
hooks, etc. which might not be safe to run. */ hooks, etc. which might not be safe to run.
This may GC (insert may run before/after change hooks),
so the buffer M must NOT point to a Lisp string. */
   
void void
message_dolog (m, nbytes, nlflag, multibyte) message_dolog (m, nbytes, nlflag, multibyte)
...@@ -6963,10 +6966,7 @@ message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte) ...@@ -6963,10 +6966,7 @@ message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte)
out any existing message, and let the mini-buffer text show out any existing message, and let the mini-buffer text show
through. through.
   
The buffer M must continue to exist until after the echo area gets This may GC, so the buffer M must NOT point to a Lisp string. */
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 void
message2 (m, nbytes, multibyte) message2 (m, nbytes, multibyte)
...@@ -8023,7 +8023,11 @@ truncate_message_1 (nchars, a2, a3, a4) ...@@ -8023,7 +8023,11 @@ truncate_message_1 (nchars, a2, a3, a4)
   
If S is not null, set the message to the first LEN bytes of S. LEN If S is not null, set the message to the first LEN bytes of S. LEN
zero means use the whole string. MULTIBYTE_P non-zero means S is zero means use the whole string. MULTIBYTE_P non-zero means S is
multibyte. Display the message multibyte in that case. */ multibyte. Display the message multibyte in that case.
Doesn't GC, as with_echo_area_buffer binds Qinhibit_modification_hooks
to t before calling set_message_1 (which calls insert).
*/
   
void void
set_message (s, string, nbytes, multibyte_p) set_message (s, string, nbytes, multibyte_p)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment