From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27871 invoked by alias); 8 Jun 2009 09:09:49 -0000 Received: (qmail 27836 invoked by uid 22791); 8 Jun 2009 09:09:46 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_50,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; Mon, 08 Jun 2009 09:09:37 +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 n5899Zhb023241; Mon, 8 Jun 2009 05:09:35 -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 n5899TPU019376; Mon, 8 Jun 2009 05:09:29 -0400 Received: from zebedee.pink (vpn-12-4.rdu.redhat.com [10.11.12.4]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5899R6x019223; Mon, 8 Jun 2009 05:09:28 -0400 Message-ID: <4A2CD546.7030603@redhat.com> Date: Mon, 08 Jun 2009 09:09:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: abhishek desai CC: java@gcc.gnu.org Subject: Re: Using libgcj with different memory management library. References: <898285d30906080005n72191f9bn8bf8eb76ff689d18@mail.gmail.com> In-Reply-To: <898285d30906080005n72191f9bn8bf8eb76ff689d18@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00022.txt.bz2 abhishek desai wrote: > 1. As per my understanding libgcj uses boehm garbage collector for > memory allocations. Are there any allocations in libgcj which are > not routed to the garbage collector ? specially the parts of the > library written in C++. From what I understand is that the memory > allocated with the 'new' operator are routed to the gc . Not exactly. If you have a Java class, i.e. one which inherits from java.lang.Object, then its new uses the GC. > Is it necessary that the class of object being allocated should be > derived from the 'object' class for it to be allocated on the gc ? > or all the allocations with new get routed to gc ? > http://gcc.gnu.org/onlinedocs/gcj/Object-allocation.html#Object-allocation Yes, it is. Of course, you can always overload new in your own classes to use the Boehm gc, evernif they don't derive from Object. You'll have to make sure they're marked correctly, though. > 2. I have a memory manager which allocates memory from a specific > memory pool. I want to port boehm gc to use this memory manager for > its allocations. I don't understand how this can work. The gc is a memory manager; how can it use some other memory manager to do its own work? You'll have to explain a little more. > Can someone give me some pointers as to where I can make the > necessary modifications ? I can see the gcconfig.h and os_dep.c is > the file containing the final system memory allocation calls. Is > there some other place I need to look at ? Are there any tricky > issues I need to look at while doing the porting ? You'll need to the gc just to scan your memory pool, or also manage it? Doing the latter will be hard, the former easy. Andrew.