From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14063 invoked by alias); 20 Oct 2011 11:57:11 -0000 Received: (qmail 14052 invoked by uid 22791); 20 Oct 2011 11:57:10 -0000 X-SWARE-Spam-Status: No, hits=0.9 required=5.0 tests=AWL,BAYES_00,BOTNET X-Spam-Check-By: sourceware.org Received: from smtp-104-thursday.noc.nerim.net (HELO mallaury.nerim.net) (178.132.17.104) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Oct 2011 11:56:54 +0000 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by mallaury.nerim.net (Postfix) with ESMTPS id 27B0F15341F; Thu, 20 Oct 2011 13:56:53 +0200 (CEST) Received: from basile18 by hector.lesours with local (Exim 4.76) (envelope-from ) id 1RGrEy-0003ts-Kk; Thu, 20 Oct 2011 13:56:52 +0200 Date: Thu, 20 Oct 2011 12:27:00 -0000 From: Basile Starynkevitch To: Laurynas Biveinis Cc: gcc@gcc.gnu.org Subject: Re: adding destroyable objects into Ggc Message-ID: <20111020115652.GA14705@ours.starynkevitch.net> References: <20111018171201.361304028ab94f102f827bd2@starynkevitch.net> <20111018191350.470cd6b1cd291373d5ff3f2c@starynkevitch.net> <20111019135602.GA19325@ours.starynkevitch.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00343.txt.bz2 On Thu, Oct 20, 2011 at 11:28:40AM +0300, Laurynas Biveinis wrote: > 2011/10/19 Basile Starynkevitch : > > On Wed, Oct 19, 2011 at 04:31:48PM +0300, Laurynas Biveinis wrote: > >> In the end I believe that it is the patches that talk. Whatever > >> patches are going to be submitted, reviewed and accepted, that is > >> going to be GCC's future, be it memory management, or something els > > > > > > I was beginning to work on a patch to add finalizable (that is destroyable) > > objects to Ggc. So I understand you Laurynas suggest that it might be worth > > working on it (while I percieved most other emails, e.g. Ian's or Duncan's > > messages, as a hint to avoid losing my time). > > I'm not sure in this case. I think that C++ would reduce the need for > it, but you need the feature *now*, and GCC codebase is not C++ yet. I > agree with other suggestions that the safest option for you is to make > it MELT-specific. Or, you could use C++ in MELT. > > In any case I cannot offer much of opinion, should you work on this or > not. Sorry. To be clear, I don't need finalized objects myself, and I don't need them in MELT neither. (MELT runtime has already ad-hoc finalization for some few MELT values, notably those boxing PPL stuff. That finalization uses the existing Ggc plugin hooks.). So, I am trying to add finalized objects in Ggc not for MELT (it does not need them, and it already has some finalization tricks which I could use when some GCC begins to use C++ objects), but for general use. I still don't grasp how a future GCC coded in C++ could realistically avoid Ggc, because nobody (amongst those advocating C++ smart or whatever _ptr-s) explained how he believes the current GCC GTY-ed representations (like tree, gimple, gimple_seq, edge, loop-s...) could be re-implemented in C++ using C++ tricks without Ggc, and what could be the transition from the current state of GCC to such a future state (C++--full, but Ggc-less) of GCC. I'm quite confident that if I continue working on MELT (which I hope to, and I believe I will) and if GCC is going entirely the C++ way (which I don't hope that much, but apparently it is the way it is going) I would be able to adapt MELT to whatever coding rules & styles GCC will require. But I don't understand how Ggc could be avoided (and I am not sure to understand how even LLVM can avoid any kind of garbage collection in the long run). What I do hope, is that when Gcc becomes written in C++, the coding rules and styles for manual memory management would be well documented. Apparently, adding finalization into Ggc seems quite easy (but until I did it, I can be wrong). And my feeling is that, together with some support for GTY-ed classes in gengtype, that could offer a realistic transition route to more C++ inside GCC. And be able to use more of PPL stuff inside plugins and passes seems to motivate & justify adding finalizers in Ggc (and later, C++ support in gengtype). I might be grossly wrong, but nobody explained -with concrete examples- us how the current major GCC representations could be done inside GCC with C++ but without Ggc. For instance, nobody explained what an hypothetical class Gimple or class Gimple_Seq could be. Cheers. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***