From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SPilAK3EgF8iEgAAWB0awg (envelope-from ) for ; Fri, 09 Oct 2020 16:14:37 -0400 Received: by simark.ca (Postfix, from userid 112) id 0090D1EF6F; Fri, 9 Oct 2020 16:14:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A55931E58D for ; Fri, 9 Oct 2020 16:14:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3C36D3851C27; Fri, 9 Oct 2020 20:14:36 +0000 (GMT) Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTP id E98003851C27 for ; Fri, 9 Oct 2020 20:14:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E98003851C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=brobecker@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A28AC560C9; Fri, 9 Oct 2020 16:14:33 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com 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 cAaWChXkeK0O; Fri, 9 Oct 2020 16:14:33 -0400 (EDT) Received: from takamaka.brobecker.org (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 73CC9560C8; Fri, 9 Oct 2020 16:14:33 -0400 (EDT) Received: by takamaka.brobecker.org (Postfix, from userid 1000) id F00D5849D7; Fri, 9 Oct 2020 13:14:31 -0700 (PDT) Date: Fri, 9 Oct 2020 13:14:31 -0700 From: Joel Brobecker To: Tom Tromey Subject: Re: [PATCH 2/2] Use obstack in ada_encode_1 Message-ID: <20201009201431.GB17417@adacore.com> References: <20201002202604.1517475-1-tromey@adacore.com> <20201002202604.1517475-3-tromey@adacore.com> <2d52a731-17e4-4a8f-0916-9a2203b0c94d@simark.ca> <87o8ldopdq.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o8ldopdq.fsf@tromey.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Marchi , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" > Yeah, actually it is probably a better API to simply return a new > string. I avoided this since I wasn't sure about why the function is > the way it is -- is it to avoid the difficulties of managing an > allocation in C, or is it to avoid extra allocations? But I looked at > the callers and I think it will be fine. FWIW, a lot of it was before I started working on GDB, but my understanding was that this was really meant to help managing allocation lifetime, which as we know is tricky in C. If std::string makes sense, I would indeed use that. I don't think this area is a hot-spot during performance-sensitive operations. -- Joel