From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26483 invoked by alias); 26 Oct 2008 15:19:12 -0000 Received: (qmail 26474 invoked by uid 22791); 26 Oct 2008 15:19:11 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 26 Oct 2008 15:18:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A876D2A9646; Sun, 26 Oct 2008 11:18:34 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FyJnJGyfosXM; Sun, 26 Oct 2008 11:18:34 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 656FF2A9642; Sun, 26 Oct 2008 11:18:34 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id F13D9E7ACD; Sun, 26 Oct 2008 08:18:31 -0700 (PDT) Date: Sun, 26 Oct 2008 15:19:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: Ulrich Weigand , gdb-patches@sourceware.org Subject: Re: [RFC/RFA] add struct parse_context to all command functions Message-ID: <20081026151831.GA3617@adacore.com> References: <200810231949.m9NJnBUn013007@d12av02.megacenter.de.ibm.com> <20081025162453.GJ29998@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00648.txt.bz2 > Joel> I like the idea as well. Just one question: Why did you elect to > Joel> pass the structure as a pointer, rather than the structure > Joel> itself? > > To avoid copying. Most users just reference fields from the > structure, or pass it through unmodified. So, this is more efficient > in the common cases. Ah, yes, of course. I was just confused with the pass-by-reference at the ABI level. I think the same reasons apply to struct parse_context, so I'll adjust my approach accordingly - even if the structure is small right now (3 words for now), it's still bigger than 1 address... -- Joel