harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulex Yang <paulex.y...@gmail.com>
Subject Re: [classlib] mem
Date Mon, 26 Jun 2006 08:54:32 GMT
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. :)
Yes,  they are same in general case. And I think the hymem_xxxx_xxx 
usage is prefered, because they are more handy and they encapsulate the 
HyPortLibrary's structure.

However, sometimes the two usage maybe different,  it is possible to 
create multiple HyPortLibrary instance within one VM instance, and the 
developer can specify which HyPortLibrary instance he wants to use by 
explicitly invoke portLib->blabla.
>
>> geir
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>
>


-- 
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


Mime
View raw message