harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][luni] the same OSMemory.h in windows and unix
Date Mon, 01 Dec 2008 09:40:47 GMT
Regis wrote:
> Tony Wu wrote:
>> I think so. since we already have the OSMemoryWin32 and
>> OSMemoryLinux32.c for the different implementation.
> Thanks your reminder, I just noticed that :)
> So in my understanding, the platform dependent code should be placed in
> OSMemoryWin32/OSMemoryLinux32, others should be moved to "shared"
> directory, right?

Yes, that is right.

FYI
On 64-bit platforms we use the full range of jlong to hold the allocated
memory pointer, but on 32-bit platforms we only use half of it.
The extra cast ((void *) ((IDATA) address)) is to ensure that the
address value is first cast to an int the right width for a platform
pointer, or else the compiler will rightly complain about the truncated
value.

When you do the merge, take the double cast version.

Regards,
Tim


Mime
View raw message