unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>, Eli Zaretskii <eliz@gnu.org>
Cc: phst@google.com, emacs-devel@gnu.org
Subject: Re: emacs-module.c, eassert, and nonnull args
Date: Mon, 12 Jun 2017 14:34:50 +0000	[thread overview]
Message-ID: <CAArVCkRszRZ6ueSqZ3FFfVWmGFoPU-hioCBD+TxWjsk_5Ec-8g@mail.gmail.com> (raw)
In-Reply-To: <CAArVCkR4pU-SiH+_0Oaq5NbOL8rJAojMBVRNPzrrKnGi6dw3sA@mail.gmail.com>

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

Philipp Stephani <p.stephani2@gmail.com> schrieb am So., 11. Juni 2017 um
22:34 Uhr:

> Paul Eggert <eggert@cs.ucla.edu> schrieb am So., 11. Juni 2017 um
> 19:45 Uhr:
>
>> Philipp Stephani wrote:
>> > Here's a new patch. It makes this change, and also changes the
>> allocation
>> > slightly so that objects have unique addresses (useful for checking).
>>
>> Thanks for working on this. Some comments.
>>
>> Have you looked into the runtime overhead of this approach, assuming
>> -module-assertions is not specified? Currently lisp_to_value and
>> value_to_lisp
>> typically  are optimized away (i.e., zero machine instructions), and that
>> wouldn't be true under the proposed patch even when -module-assertions is
>> not
>> used. Granted, module calls need not be super-fast, but it might be nice
>> to
>> avoid the overhead in the typical case if that is easy.
>>
>
> I've run a simple benchmark (5000000 iterations of mod-test-sum). Result
> for the base case (module assertions not compiled) is 4.602 seconds, with
> the new code it's 4.605 seconds. That's probably good enough.
>
>
>>
>> What happens if -module-assertions is enabled for Emacs, Emacs dumps
>> itself, and
>> -module-assertions is not enabled when the dumped Emacs is run?
>
>
> Good question. I've now just made -module-assertions during dumping an
> error.
>
>
>> Or vice versa.
>>
>
> That's the normal case, which should work just fine.
>
>
>>
>> Are the FOR_EACH_TAIL_SAFE macro calls needed? This macro is needed only
>> for
>> lists that might be circular (e.g., the lists are available to Lisp code,
>> which
>> can call setcdr on their components). If the calls are not needed I
>> suggest just
>> an ordinary for loop.
>>
>
> Done.
>
>
>>
>> A small point: the FOR_EACH... loops should be indented like ordinary
>> for-loops.
>>
>
> Done. (Would be great if CC-Mode knew about this.)
>

I've now pushed this commit and also a commit that uses
__attribute__((nonnull)) to master.

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

      reply	other threads:[~2017-06-12 14:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05  2:48 emacs-module.c, eassert, and nonnull args Paul Eggert
2017-06-05 13:56 ` Philipp Stephani
2017-06-05 15:33   ` Eli Zaretskii
2017-06-11 13:50     ` Philipp Stephani
2017-06-11 17:45       ` Paul Eggert
2017-06-11 20:34         ` Philipp Stephani
2017-06-12 14:34           ` Philipp Stephani [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAArVCkRszRZ6ueSqZ3FFfVWmGFoPU-hioCBD+TxWjsk_5Ec-8g@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=phst@google.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).