GNU bug report logs - #22737
25.1; Finalizer should be optional in dynamic modules

Previous Next

Package: emacs;

Reported by: Jess Balint <jbalint <at> gmail.com>

Date: Thu, 18 Feb 2016 21:58:02 UTC

Severity: normal

Tags: notabug, wontfix

Found in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jess Balint <jbalint <at> gmail.com>
Cc: 22737 <at> debbugs.gnu.org
Subject: bug#22737: 25.1; Finalizer should be optional in dynamic modules
Date: Fri, 19 Feb 2016 11:33:55 +0200
> From: Jess Balint <jbalint <at> gmail.com>
> Date: Thu, 18 Feb 2016 15:52:55 -0600
> 
> Dynamic modules are really cool so far, but I think finalizers should
> not be mandatory for user pointers (alloc.c):
> 
> #ifdef HAVE_MODULES
> 	      else if (mblk->markers[i].m.u_any.type == Lisp_Misc_User_Ptr)
> 		{
> 		  struct Lisp_User_Ptr *uptr = &mblk->markers[i].m.u_user_ptr;
> 		  uptr->finalizer (uptr->p); <----- should NULL-check first
> 		}
> #endif
> 
> c.f. https://github.com/emacs-mirror/emacs/blob/master/src/alloc.c#L6893

Can you tell more about the use case where you needed this change?  A
user-pointer holds a pointer to some unspecified data, and that data
needs to be free'd when the user-pointer object is GC'ed; failure to
do so will cause memory leaks.  When is the above incorrect, or gets
in your way?

Thanks.




This bug report was last modified 5 years and 316 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.