* freeing the memory from build_string
@ 2013-10-31 6:58 Jarek Czekalski
2013-10-31 8:08 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Jarek Czekalski @ 2013-10-31 6:58 UTC (permalink / raw)
To: emacs-devel
I was trying to google for Elisp memory management, but found nothing.
I don't understand in what way the memory is freed, that is allocated by
build_string. The use case is in keyboard.c, cmd_error_internal.
call3 (Vcommand_error_function, data,
context ? build_string (context) : empty_unibyte_string,
Vsignaling_function);
Here "context" is a "const char *" function argument, passed to
cmd_error_internal.
The function that receives the lisp string context is a user function,
usually not used. What makes as sure, that the memory allocated for the
string inside lisp object will ever be returned?
Thanks,
Jarek
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: freeing the memory from build_string
2013-10-31 6:58 freeing the memory from build_string Jarek Czekalski
@ 2013-10-31 8:08 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2013-10-31 8:08 UTC (permalink / raw)
To: Jarek Czekalski; +Cc: emacs-devel
Jarek Czekalski <jarekczek@poczta.onet.pl> writes:
> The function that receives the lisp string context is a user function,
> usually not used. What makes as sure, that the memory allocated for the
> string inside lisp object will ever be returned?
It will happen during GC once the Lisp object is no longer referenced.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-31 8:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 6:58 freeing the memory from build_string Jarek Czekalski
2013-10-31 8:08 ` Andreas Schwab
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).