From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43355 invoked by alias); 18 Jun 2019 21:25:01 -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 43344 invoked by uid 89); 18 Jun 2019 21:25:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=releasing, HContent-Transfer-Encoding:8bit X-HELO: mailsec101.isp.belgacom.be Received: from mailsec101.isp.belgacom.be (HELO mailsec101.isp.belgacom.be) (195.238.20.97) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jun 2019 21:24:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1560893097; x=1592429097; h=message-id:subject:from:to:date:in-reply-to:references: mime-version:content-transfer-encoding; bh=0qPdzM1osHRw7Jb/4LKBewIZpRXAN4GQ/0L4MHCDA+k=; b=VD9CXdmcebggs3tfHPQVzSE1wZ14SkQVY6EboxT0phMexcNZ+hHg1qQM hCmV8WArk1ntuA6l4ZYvagOirPTl5A==; Received: from unknown (HELO md) ([109.128.218.96]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 18 Jun 2019 23:24:55 +0200 Message-ID: <1560893094.8865.7.camel@skynet.be> Subject: Re: [PATCH] Instantiate a single source highlighter From: Philippe Waroquiers To: Pedro Alves , Tom Tromey , gdb-patches@sourceware.org Date: Tue, 18 Jun 2019 21:25:00 -0000 In-Reply-To: References: <20190618194053.7515-1-tromey@adacore.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00364.txt.bz2 On Tue, 2019-06-18 at 21:20 +0100, Pedro Alves wrote: > > +/* The global source highlight object, or null if one was never > > +   constructed.  This is stored here rather than in the class so that > > +   we don't need to include anything or do conditional compilation in > > +   source-cache.h.  */ > > +#ifdef HAVE_SOURCE_HIGHLIGHT > > +static srchilite::SourceHighlight *highlighter; > > +#endif > > Should it be a unique_ptr so that valgrind doesn't complain about > it leaking when gdb exits? As highlighter is a global static variable, when GDB exits, valgrind will consider the memory as reachable and not a leak. So, from only a valgrind point of view, there is no reason to have GDB releasing this memory automatically when exiting. Philippe