From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9898 invoked by alias); 2 Nov 2017 09:29:43 -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 9595 invoked by uid 89); 2 Nov 2017 09:29:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:74.125.82.67, H*RU:74.125.82.67, shorten, H*Ad:D*ca X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Nov 2017 09:29:42 +0000 Received: by mail-wm0-f67.google.com with SMTP id r196so9582083wmf.2 for ; Thu, 02 Nov 2017 02:29:41 -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=iC3vBMhiVzAFY3U/mqST3ReSWEBzDRkEbkriv8N+5x4=; b=fm2VIohZtGe4S2O8H28e0Ym4rNaq4xbPkzks4hK3SJKHrQnaKmCOLsnJg4LhUbaUH+ 7b1R8Mglv8OHSo+ymAa+FWew4eg6g+VSbVWOV6Ht25yVCr0PDspHPRYtFUDxWF7SbbFK 2A18V64T5mioTMF9KkR8YMI0qdVkLwGJLNA5Xw+NpdcSuzPMlqMiN3Nl+0D4F2piO5rw SeApUhWqHuCq5Q1JgpK7u+/iAJWrAWsHSLp9Jj4Ea/I7unk2cN6ILxBgjwwxzTeLOuK9 ovMNa1UIlTpDdHBMlvndFDF/M4/I28mVmSqVkNNpjkvXuJfxG2hZAiW1iMnqKdCRNaX4 xH/g== X-Gm-Message-State: AMCzsaWMT9RhnqYA8LQZpbR2FQFgUIjfkk+jGeanM0e7a4jbHRcc28+g rdHq1uno1+Y4+d5u4dErD71+Jw== X-Google-Smtp-Source: ABhQp+SNKwpX3z2mTGSi7ZoUNvBo4dQCNNpZsaYUIcfmT78iW5KQ0MuTNxV/xaz+bh65LquXkQ/k+g== X-Received: by 10.28.236.203 with SMTP id h72mr1092334wmi.147.1509614980070; Thu, 02 Nov 2017 02:29:40 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id f27sm5325923wrf.63.2017.11.02.02.29.39 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 02 Nov 2017 02:29:39 -0700 (PDT) From: Yao Qi To: Simon Marchi Cc: , Simon Marchi Subject: Re: [PATCH 03/10] Make target_desc::features an std::vector References: <1509414120-14659-1-git-send-email-simon.marchi@ericsson.com> <1509414120-14659-4-git-send-email-simon.marchi@ericsson.com> Date: Thu, 02 Nov 2017 09:29:00 -0000 In-Reply-To: <1509414120-14659-4-git-send-email-simon.marchi@ericsson.com> (Simon Marchi's message of "Mon, 30 Oct 2017 21:41:53 -0400") Message-ID: <868tfpxc3l.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-11/txt/msg00021.txt.bz2 Simon Marchi writes: Patch is good to me, two comments below, > +typedef std::unique_ptr tdesc_feature_up; >=20=20 > /* A target description. */ >=20=20 > @@ -393,17 +394,7 @@ struct target_desc : tdesc_element > target_desc () > {} >=20=20 > - virtual ~target_desc () > - { > - struct tdesc_feature *feature; > - int ix; > - > - for (ix =3D 0; > - VEC_iterate (tdesc_feature_p, features, ix, feature); > - ix++) > - delete feature; > - VEC_free (tdesc_feature_p, features); > - } > + virtual ~target_desc () =3D default; >=20=20 Can't we remove this line and use default (compiler generated) dtor? > target_desc (const target_desc &) =3D delete; > void operator=3D (const target_desc &) =3D delete; > @@ -422,17 +413,13 @@ struct target_desc : tdesc_element > std::vector properties; >=20=20 > /* The features associated with this target. */ > - VEC(tdesc_feature_p) *features =3D NULL; > + std::vector> features; >=20=20 std::vector features; shorten the code. --=20 Yao (=E9=BD=90=E5=B0=A7)