From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109472 invoked by alias); 16 May 2017 14:08:59 -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 109442 invoked by uid 89); 16 May 2017 14:08:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:916 X-HELO: mail-pf0-f173.google.com Received: from mail-pf0-f173.google.com (HELO mail-pf0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 May 2017 14:08:57 +0000 Received: by mail-pf0-f173.google.com with SMTP id e193so80997126pfh.0 for ; Tue, 16 May 2017 07:09:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=LU72yAda4JRgElAJi9Z5g6hkBKnJdWfvaZv5Gf87oZs=; b=Ke6nJbBt9KPijjRJQLfB26S+4TSzIpKdgtqY06uPFSFcp1G9wEpYk/E7Cfk1ZOcZA8 SKD6BPkO633yNBfgnlGyfm8G6a0FSq3eodAQIqrTldaAiyJJ1M6aI6+xy6qt83vkVj+z kTAj8ULFUY44tibUm+QKvAhYo9AgH8c1JkFEX+8C5DHJfGEmDE3A3SdrWSyb1Lno666f nf2UX3e4va/siw/5mM0UgschvfM5HJE9sn08yMMyj0V1nE4vYB8i+Foipx6/rPu5sZ/v 75JElP68WWJpBx5LBYfAJUJNYBaT/N0vzQNdT/5uKBP9HpCAkcUsGpdUFAjmihpDzja3 K07Q== X-Gm-Message-State: AODbwcANf/lu3Fi7crf82/aXgraGZLp9m/AZkrmM+O72UUAnk6sSx0id /NhpcSwlEutKlw== X-Received: by 10.84.179.65 with SMTP id a59mr16167802plc.171.1494943738738; Tue, 16 May 2017 07:08:58 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id l7sm35711254pgn.10.2017.05.16.07.08.57 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 16 May 2017 07:08:58 -0700 (PDT) From: Yao Qi To: Andreas Arnez Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 12/19] read/write_pieced_value: Drop 'buffer_size' variable References: <1494352015-10465-1-git-send-email-arnez@linux.vnet.ibm.com> <1494352015-10465-13-git-send-email-arnez@linux.vnet.ibm.com> Date: Tue, 16 May 2017 14:08:00 -0000 In-Reply-To: <1494352015-10465-13-git-send-email-arnez@linux.vnet.ibm.com> (Andreas Arnez's message of "Tue, 9 May 2017 19:46:08 +0200") Message-ID: <86efvoao7c.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00349.txt.bz2 Andreas Arnez writes: Patch is good to me, a nit below, > @@ -1806,12 +1805,8 @@ read_pieced_value (struct value *v) > this_size_bits =3D max_offset - offset; >=20=20 > this_size =3D (this_size_bits + source_offset_bits % 8 + 7) / 8; > + buffer.reserve (this_size); I noticed that buffer is only used within the for loop, so probably we can move it into the loop, and do "std::vector buffer (this_size)= ;" This change makes troubles for you to rebase your following patches, so if you want to change it, you can do it in another patch, 20/19, for example. > source_offset =3D source_offset_bits / 8; > - if (buffer_size < this_size) > - { > - buffer_size =3D this_size; > - buffer.reserve (buffer_size); > - } > intermediate_buffer =3D buffer.data (); >=20=20 > /* Copy from the source to DEST_BUFFER. */ --=20 Yao (=E9=BD=90=E5=B0=A7)