From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25978 invoked by alias); 16 Apr 2009 19:32:25 -0000 Received: (qmail 25963 invoked by uid 22791); 16 Apr 2009 19:32:24 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Apr 2009 19:32:16 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3GJWExu014993 for ; Thu, 16 Apr 2009 15:32:14 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3GJWDOs014104; Thu, 16 Apr 2009 15:32:13 -0400 Received: from opsy.redhat.com (vpn-12-173.rdu.redhat.com [10.11.12.173]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3GJWC0m024765; Thu, 16 Apr 2009 15:32:12 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id BC7D950830B; Thu, 16 Apr 2009 13:32:11 -0600 (MDT) To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] [0/5] Types reference counting (for VLA+Python) References: <20090411102003.GA32624@host0.dyn.jankratochvil.net> From: Tom Tromey Reply-To: tromey@redhat.com Date: Thu, 16 Apr 2009 19:32:00 -0000 In-Reply-To: <20090411102003.GA32624@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Sat\, 11 Apr 2009 12\:20\:03 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2009-04/txt/msg00386.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> currently GDB knows only permanent types and objfile-associated Jan> types. GDB currently does not need more. The only special kind Jan> are types copied from closed objfiles for value history. As the Jan> value history is always kept in full length such types are in Jan> fact also permanent. FWIW, you can get a memory leak here with CVS gdb by setting a convenience variable to a value whose type comes from an objfile, closing all the objfiles ("file"), and then assigning a new value to the convenience variable. In this case nothing frees the type. Jan> To be true there exist some artificial temporary types such as in Jan> value_cast [...] Jan> , these can be freed by this implemented garbage collecting Jan> infrastructure. These are already leaking in current FSF GDB; Jan> fix based on this framework is currently not a part of this Jan> patchset. Why is that? (It doesn't matter in terms of acceptance, I'm just curious.) Jan> This is a work based on Tom Tromey's original one but it got Jan> changed a lot so blames to me first. :-) Jan> The basic decisions of this patchset are about the differences Jan> between permant types (currently having TYPE_OBJFILE == NULL) and Jan> garbage collectable (=reclaimable) types: Jan> * Should the default allocation of types (alloc_type (NULL)) Jan> provide permanent type or a garbage collectable type? Jan> = Currently it creates a permanent type. Too bad the other approach didn't work out. Where do all these permanent types come from? Not just init_type, I gather. It seems strange to have a type-crawling garbage collector *and* reference counting. But I suppose this is because enumerating the root set is tricky. Jan> Not tested with the Python branch (which will need to Jan> explicitely define the allocated types as reclaimable). I'll handle this, assuming the timing is right. We're accumulating quite a backlog of patches to be applied after the pretty-printing series :-( I think your approach seems sane in general. I will comment on the individual patches soon. Tom