Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 33948 invoked from network); 26 Jun 2006 09:24:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2006 09:24:50 -0000 Received: (qmail 17921 invoked by uid 500); 26 Jun 2006 09:24:47 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 17881 invoked by uid 500); 26 Jun 2006 09:24:46 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 17869 invoked by uid 99); 26 Jun 2006 09:24:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 02:24:46 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 202.81.18.155 is neither permitted nor denied by domain of paulex.yang@gmail.com) Received: from [202.81.18.155] (HELO ausmtp06.au.ibm.com) (202.81.18.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 02:24:45 -0700 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp06.au.ibm.com (8.13.6/8.13.6) with ESMTP id k5Q9QH2X7676136 for ; Mon, 26 Jun 2006 19:26:19 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k5Q9Raca175144 for ; Mon, 26 Jun 2006 19:27:42 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k5Q9OEYq011003 for ; Mon, 26 Jun 2006 19:24:14 +1000 Received: from d23m0011.cn.ibm.com (d23m0011.cn.ibm.com [9.181.32.74]) by d23av03.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k5Q9OC3W010886 for ; Mon, 26 Jun 2006 19:24:14 +1000 Received: from [127.0.0.1] ([9.181.106.114]) by d23m0011.cn.ibm.com (Lotus Domino Release 6.5.5HF262) with ESMTP id 2006062617240324-3956 ; Mon, 26 Jun 2006 17:24:03 +0800 Message-ID: <449FA7B3.5020200@gmail.com> Date: Mon, 26 Jun 2006 17:24:03 +0800 From: Paulex Yang User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib] mem References: <449DC023.4030907@pobox.com> <449F9874.2000909@gmail.com> <449FA3AA.4080401@gmail.com> In-Reply-To: <449FA3AA.4080401@gmail.com> X-MIMETrack: Itemize by SMTP Server on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 26/06/2006 17:24:07, Serialize by Router on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 26/06/2006 17:24:13, Serialize complete at 26/06/2006 17:24:13 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Tim Ellison wrote: > Jimmy, Jing Lv wrote: > >> Geir Magnusson Jr wrote: >> >>> Why would I use >>> >>> portLib->mem_allocate_memory(portLib....) >>> >>> over just calling >>> >>> hymem_allocate_memory(portlib, ....) >>> >>> >> Hi Geir: >> >> Not sure if the later is "hymem_allocate_memory(int size)"? If so, >> they are the same indeed, and the later is the a macro. Everytime before >> we use the macro, call "PORT_ACCESS_FROM_ENV (env)" >> e.g.: >> somemethod(JNIEnv * env, ...){ >> PORT_ACCESS_FROM_ENV (env); >> ... >> hymem_allocate_memory(sizeof(something)); >> ... >> } >> >> And they are defined in hyport.h. :) >> > > I think the second style is more readable, so would advocate using that. > > As you say, the readable macros are set up using the PORT_ACCESS_FROM_* > directives, so that you can use them if you are passed different types. > > PORT_ACCESS_FROM_ENV(JNIEnv) - you have a JNIEnv struct ptr > PORT_ACCESS_FROM_JAVAVM(JavaVM) - you have a JavaVM struct ptr > > PORT_ACCESS_FROM_PORT(portlib) - you have a portlib ptr > So in the scenario of multiple HyPortLib instances, it can be used to specify which one to use? Then how about document these directives and advocation on the port documentation instead of current ones? > Regards, > Tim > > -- Paulex Yang China Software Development Lab IBM --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org