From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26636 invoked by alias); 10 Apr 2008 04:26:32 -0000 Received: (qmail 26603 invoked by uid 22791); 10 Apr 2008 04:26:32 -0000 X-Spam-Check-By: sourceware.org Received: from an-out-0708.google.com (HELO an-out-0708.google.com) (209.85.132.240) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Apr 2008 04:26:12 +0000 Received: by an-out-0708.google.com with SMTP id c3so644141ana.104 for ; Wed, 09 Apr 2008 21:26:07 -0700 (PDT) Received: by 10.100.33.9 with SMTP id g9mr1801130ang.105.1207801567242; Wed, 09 Apr 2008 21:26:07 -0700 (PDT) Received: from ?192.168.0.11? ( [208.59.133.55]) by mx.google.com with ESMTPS id 23sm874461hsd.10.2008.04.09.21.26.06 (version=SSLv3 cipher=RC4-MD5); Wed, 09 Apr 2008 21:26:06 -0700 (PDT) Subject: how to pass params to inline functions by reference or value? From: VM To: gcc-help@gcc.gnu.org Content-Type: text/plain Date: Thu, 10 Apr 2008 05:55:00 -0000 Message-Id: <1207801566.12695.8.camel@vm-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00147.txt.bz2 Hello, I'm trying to decide on the best way to pass parameters to inline function. For example, the two functions below: inline int sum(atype_t *x) { return x->a + x->b; } and inline int sum(atype_t x) { return x.a + x.b; } Since the function is inline, my guess is that the compiler will generate identical code for both. So there should be no performance difference. Is this assumption correct? V