public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernardo Innocenti <bernie@develer.com>
To: Gunther Nikl <gni@gecko.de>
Cc: GCC Mailing List <gcc@gcc.gnu.org>,  Richard Henderson <rth@redhat.com>
Subject: Re: Testing m68k changes on AmigaOS and Linux/m68k
Date: Thu, 23 Oct 2003 20:30:00 -0000	[thread overview]
Message-ID: <3F981300.9030306@develer.com> (raw)
In-Reply-To: <20031023131324.GA28408@lorien.int.gecko.de>

Gunther Nikl wrote:

>>I used it in several projects using BOOPSI classes. As you can see,
>>I had two sets of macros because GCC did not want to inline the
>>varargs functions.
> 
>   The approach with the array is nasty :-/ Every usage of such macro
>   will create a distinc array and this will eat up stackspace. Thats
>   why I always disabled these macros.

I don't quite understand.  There's (almost) no difference in stack
space usage between this:

  {
     int v[] = { 1, 2, 3, 4, 5 };
     extern foo(int *);
     foo(v);
  }

...and this:

  {
     extern foo(...);
     foo(1, 2, 3, 4, 5);
  }


With the varargs form, the compiler will push all arguments
on the stack before calling foo(), effectively wasting the
same amount of stack space of the local array.

When I had to pass a taglist made entirely of constant
values, I used to do this instead:

   {
      static const int tags[] =
      {
          XA_Foo, 1,
          XA_Bar, 2,
          XA_Baz, 3,
          TAG_DONE
      }

      SetAttrsA(o, tags);
   }

-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/

Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html



  reply	other threads:[~2003-10-23 17:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-12  4:07 Bernardo Innocenti
2003-10-13 17:24 ` Gunther Nikl
2003-10-14 12:40   ` Bernardo Innocenti
2003-10-14 13:56     ` Gunther Nikl
2003-10-14 17:00       ` Bernardo Innocenti
2003-10-15 12:40         ` Gunther Nikl
2003-10-15 17:42           ` Gunther Nikl
2003-10-15 20:53             ` Bernardo Innocenti
2003-10-15 21:18               ` Andreas Schwab
2003-10-16 15:27               ` Gunther Nikl
2003-10-16 16:36                 ` Andreas Schwab
2003-10-16 17:27                 ` Bernardo Innocenti
2003-10-21 14:38                   ` Gunther Nikl
2003-10-21 20:33                     ` Bernardo Innocenti
2003-10-23 16:11                       ` Gunther Nikl
2003-10-23 20:30                         ` Bernardo Innocenti [this message]
2003-10-24 13:49                           ` Gunther Nikl
2003-10-25  6:04                             ` Bernardo Innocenti
2003-10-15 13:57         ` Gunther Nikl
2003-10-31 23:47 ` Matthias Klose

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=3F981300.9030306@develer.com \
    --to=bernie@develer.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gni@gecko.de \
    --cc=rth@redhat.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.
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).