unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludovic.courtes@laas.fr (Ludovic Courtès)
Subject: Re: [PATCH] Inlining `scm_is_pair ()'
Date: Wed, 25 Jan 2006 10:21:28 +0100	[thread overview]
Message-ID: <87oe20br3b.fsf@laas.fr> (raw)
In-Reply-To: <87k6cpwfkw.fsf@zip.com.au> (Kevin Ryde's message of "Wed, 25 Jan 2006 07:12:15 +1100")

Hi,

Kevin Ryde <user42@zip.com.au> writes:

> Which is probably not really in line with gnu coding standards
> (standards.info end of "Syntactic Conventions" node).  But I guess any
> application might do it.

Certainly not the only thing that's not GCS-compatible in Guile...  ;-)

> That was ceval/deval() local variables on gcc 4 last time I hit that.
> -O1 may be better, or just on eval.c at least.

Right, I don't have the "stack overflow" with `-O1', fortunately.

>> +static SCM_C_INLINE int
>
> I suspect extern inline is what you want, static inline might end up
> with a copy of the code in every file, under -O0 at least.  But extern
> inline is even more of a gcc-ism, if you're worried about the
> commercial compilers.

With `-O0', no inlining takes place, unless the `always_inline'
attribute was specified.

`extern inline' is a indeed a GCCism.  It might be better since, as you
said, it would allow a single definition to be used in the case where
inlining doesn't take place.  Quoting the GCC manual:

   If you specify both `inline' and `extern' in the function definition,
  then the definition is used only for inlining.  In no case is the
  function compiled on its own, not even if you refer to its address
  explicitly.  Such an address becomes an external reference, as if you
  had only declared the function, and had not defined it.

OTOH, the code of this function is sufficiently small so that code
duplication shouldn't be a concern---if it was, we wouldn't be inlining
in the first place.

So I think it'd make sense to apply it as is.  We'll have to ask people
who work with proprietary compilers to voice out if there's something
wrong anyway.

Thanks,
Ludovic.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2006-01-25  9:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14 14:46 [PATCH] Turning `scm_is_pair ()' into a macro Ludovic Courtès
2005-12-14 20:57 ` Kevin Ryde
2005-12-14 23:00 ` Han-Wen Nienhuys
2005-12-14 23:19 ` Marius Vollmer
2005-12-15  9:39   ` Ludovic Courtès
2005-12-16  0:08     ` Han-Wen Nienhuys
2005-12-16 10:01       ` Ludovic Courtès
2006-01-24  8:37         ` [PATCH] Inlining `scm_is_pair ()' Ludovic Courtès
2006-01-24 20:12           ` Kevin Ryde
2006-01-25  9:21             ` Ludovic Courtès [this message]
2006-01-26 23:13               ` Kevin Ryde
2006-01-27  9:13                 ` Ludovic Courtès
2006-01-28 22:07           ` Marius Vollmer
2006-01-30  9:06             ` Ludovic Courtès
2006-02-03 23:49             ` Kevin Ryde
2006-02-05 19:10               ` Marius Vollmer
2005-12-16  0:41   ` [PATCH] Turning `scm_is_pair ()' into a macro Kevin Ryde
2005-12-16 20:01     ` Marius Vollmer

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/guile/

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

  git send-email \
    --in-reply-to=87oe20br3b.fsf@laas.fr \
    --to=ludovic.courtes@laas.fr \
    /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.
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).