From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18446 invoked by alias); 1 Jul 2013 16:05:48 -0000 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 Received: (qmail 18435 invoked by uid 89); 1 Jul 2013 16:05:48 -0000 X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 01 Jul 2013 16:05:48 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r61G5k88002119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Jul 2013 12:05:46 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r61G5jZQ013251; Mon, 1 Jul 2013 12:05:45 -0400 Message-ID: <51D1A8D9.40206@redhat.com> Date: Mon, 01 Jul 2013 16:05:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH 03/16] Add new_remote_state References: <1372441229-305-1-git-send-email-tromey@redhat.com> <1372441229-305-4-git-send-email-tromey@redhat.com> In-Reply-To: <1372441229-305-4-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00039.txt.bz2 On 06/28/2013 06:40 PM, Tom Tromey wrote: > +/* Allocate a new struct remote_state with xmalloc, initialize it, and > + return it. */ > + > +static struct remote_state * > +new_remote_state (void) > +{ > + struct remote_state *result = XCNEW (struct remote_state); > + > + result->buf_size = 400; > + result->buf = xmalloc (result->buf_size); I was re-reading this, and wondering "hmm, wait, where does that 400 come from?" ... > /* Description of the remote protocol for a given architecture. */ > @@ -11800,9 +11814,7 @@ _initialize_remote (void) > of these, not one per target. Only one target is active at a > time. The default buffer size is unimportant; it will be expanded > whenever a larger buffer is needed. */ ... then I notice this "The default buffer ..." comment. I think it'd be good move it too. Sorry for missing this one the first time around. > - rs = get_remote_state_raw (); > - rs->buf_size = 400; > - rs->buf = xmalloc (rs->buf_size); > + remote_state = new_remote_state (); -- Pedro Alves