Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 91444 invoked from network); 25 Jun 2008 13:15:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2008 13:15:12 -0000 Received: (qmail 57042 invoked by uid 500); 25 Jun 2008 13:15:05 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 57012 invoked by uid 500); 25 Jun 2008 13:15:05 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 56999 invoked by uid 99); 25 Jun 2008 13:15:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 06:15:05 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of t.p.ellison@gmail.com designates 66.249.92.170 as permitted sender) Received: from [66.249.92.170] (HELO ug-out-1314.google.com) (66.249.92.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 13:14:14 +0000 Received: by ug-out-1314.google.com with SMTP id t30so123369ugc.3 for ; Wed, 25 Jun 2008 06:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=nBkV734KUxMjwVSXbBzLZKbKrf0l4sAIIo2eFgq/JcA=; b=YGZf40993Z8fREb1fNjgEcMt08Q43zXIwyapaxe4hCay/mZEQHxIQgl2IU/iTbbM8Q bMYOg4bnUYzGch0cwLUZMnI0GdTTnCYE9A1FfTeW9D5Tb+Tg+EoKW/y9Doq0Vdramnpr eUz4JSNIf169Jzm6GH6G3cWmKjUcdiMx/s3DQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=NDGX4Q6Bn03gZ3C+IgYH1slbebzQrbca1EoVzFN+3zU3+SkUNY7odsEcLJtzFj3z9e uLL+e/DyNouviOQzysUUXKul6wY5cwZaGlTqQBNY5R0HFOZWr4+YaG2tMHqd+fvfsFon MvIWaVPcW3TBOkcKoJYtVtKcCbkg/t+5+HyIg= Received: by 10.210.82.2 with SMTP id f2mr1766863ebb.159.1214399672533; Wed, 25 Jun 2008 06:14:32 -0700 (PDT) Received: from ?9.20.183.77? ( [195.212.29.92]) by mx.google.com with ESMTPS id y34sm11959187iky.10.2008.06.25.06.14.31 (version=SSLv3 cipher=RC4-MD5); Wed, 25 Jun 2008 06:14:31 -0700 (PDT) Message-ID: <486244B6.3090003@gmail.com> Date: Wed, 25 Jun 2008 14:14:30 +0100 From: Tim Ellison User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: java.lang.ref.ReferenceQueue.enqueue allocates array during GC References: <48623E95.2010500@gmail.com> In-Reply-To: <48623E95.2010500@gmail.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Ian Rogers wrote: > I'm having a problem with java.lang.ref.ReferenceQueue.enqueue in that > it queues references onto an array during GC, and that this array may > need to be grown during the GC. Generating new objects during GC is > something of a gray area, in the VM I'm working with it is not allowed. > An alternative is to have a field in Reference that allows references to > be linked together. Should this approach be adopted for all of Harmony > or just within our VM? This is the approach taken by Harmony's DRLVM too. DRLVM doesn't use the implementation of ReferenceQueue in the classlib code [1], it has it's own implementation in the kernel classes [2]. This is (another) case where the contract between VM implementor and the class library code would need to be changed if we were to adopt the 'linked list' implementation of the queue. [1] http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ref/ReferenceQueue.java?view=markup [2] http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ref/ReferenceQueue.java?view=markup Regards, Tim