all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jess Balint <jbalint@gmail.com>
Cc: 22737@debbugs.gnu.org
Subject: bug#22737: 25.1; Finalizer should be optional in dynamic modules
Date: Fri, 19 Feb 2016 11:33:55 +0200	[thread overview]
Message-ID: <83lh6hrqm4.fsf@gnu.org> (raw)
In-Reply-To: <87a8mxsn2g.fsf@oracle.com> (message from Jess Balint on Thu, 18 Feb 2016 15:52:55 -0600)

> From: Jess Balint <jbalint@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.





  reply	other threads:[~2016-02-19  9:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 21:52 bug#22737: 25.1; Finalizer should be optional in dynamic modules Jess Balint
2016-02-19  9:33 ` Eli Zaretskii [this message]
2016-02-23 22:47   ` Jess Balint
2016-02-24  3:40     ` Eli Zaretskii
2016-02-26 16:17       ` Jess Balint
2016-02-26 18:36         ` Eli Zaretskii
2016-02-26 18:53           ` Jess Balint
2016-02-26 21:33             ` Eli Zaretskii
2016-02-26 21:51               ` Jess Balint
2016-02-26 21:55                 ` Daniel Colascione
2016-02-29 20:28                   ` Jess Balint

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lh6hrqm4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22737@debbugs.gnu.org \
    --cc=jbalint@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.