emacs-devel
[Top][All Lists]
Advanced

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

Re: studying emacs internals


From: Scott Lanning
Subject: Re: studying emacs internals
Date: Mon, 3 Dec 2001 22:00:40 -0500

On Mon, 3 Dec 2001, Richard Stallman wrote:
>In a few cases it is important to have a function to free the memory
>used inside the structure.  However, in most cases it is fine to let
>the space be freed by GC.  Is manual freeing better for you?

In the case I mentioned, I did use xfree() to free an int pointer
(more precisely the memory pointed to by that int pointer),
but the (arbitrary) struct was constructed with an int pointer
for that reason. :)
For the vector itself (let it be named `v'), I set v->size = 0
because I read at the bottom of gc_sweep() in alloc.c that if v->size
is zero, the garbage collector will call lisp_free() and remove the
vector from the list. Perhaps there is a more proper way to do it.




reply via email to

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