all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jess Balint <jbalint@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: John Wiegley <johnw@gnu.org>, 22737@debbugs.gnu.org
Subject: bug#22737: 25.1; Finalizer should be optional in dynamic modules
Date: Fri, 26 Feb 2016 15:51:43 -0600	[thread overview]
Message-ID: <CA+fD2U3SVA2H20RFx3H0jvO9WKnV9crhH6ipaPW0QyA7cDnyyQ@mail.gmail.com> (raw)
In-Reply-To: <83twkvcg30.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]

On Fri, Feb 26, 2016 at 3:33 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Fri, 26 Feb 2016 12:53:20 -0600
> > From: Jess Balint <jbalint@gmail.com>
> > Cc: 22737@debbugs.gnu.org
> >
> >  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.
>

All I'm asking for is to allow the code to accept a NULL finalizer. This
means no finalizer will be called. It's a clear and simple semantic. Upside
is that I (and others who do not want Emacs to free their pointers) will
not have to create a no-op function unnecessarily to supply a finalizer to
Emacs.

Thanks.

Jess

[-- Attachment #2: Type: text/html, Size: 2260 bytes --]

  reply	other threads:[~2016-02-26 21:51 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
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 [this message]
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=CA+fD2U3SVA2H20RFx3H0jvO9WKnV9crhH6ipaPW0QyA7cDnyyQ@mail.gmail.com \
    --to=jbalint@gmail.com \
    --cc=22737@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=johnw@gnu.org \
    /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.