bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22737: 25.1; Finalizer should be optional in dynamic modules


From: Eli Zaretskii
Subject: bug#22737: 25.1; Finalizer should be optional in dynamic modules
Date: Fri, 26 Feb 2016 23:33:07 +0200

> Date: Fri, 26 Feb 2016 12:53:20 -0600
> From: Jess Balint <address@hidden>
> Cc: address@hidden
> 
>  What will happen if such objects are exposed to Lisp, copied or
>  assigned to other Lisp variables, etc.? Won't this cause all kinds of
>  trouble, like modifying one such object will magically modify several
>  others, which share its storage?
> 
> This is how C code works. If you return a pointer from a function, you may 
> have to free that pointer yourself or
> you may not. You may get the same pointer back from multiple calls to the 
> same function. If you use the
> pointer after it's been freed, it's your problem. You need to agree with the 
> owner of the pointer how the
> memory is to be managed. With pointers, modifications to the underlying data 
> are visible by all who have a
> pointer to the data. I wouldn't call this "magically modifying others".

In C, yes.  But we are talking about Lisp objects here.

Am I the only one who is uneasy with supporting such Lisp objects?  If
so, I will shut up and install the changes.  Daniel, John, what's your
opinion on this?

Thanks.





reply via email to

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