[Gc] gc7 and 64-bit platforms

Peter Colson pcolson at connexus.net.au
Mon Nov 15 22:54:56 PST 2004


On 16/11/2004, at 5:27 PM, MenTaLguY wrote:

> On Mon, 2004-11-15 at 22:41, Peter Colson wrote:
>> Also, possibly more widespread, interchanging size_t and word usage
>> (allchblk, GC_allocchblk and GC_allocchblk_nth sz param,  and
>> elsewhere). On an LP64 platform do you imagine that size_t would be
>> promoted to an 8-byte size as per long? On my LLP64 platform size_t
>> remains at 4 bytes (unsigned long) while word becomes 8-bytes 
>> (unsigned
>> long long)? So is this interchange of word and size_t vars valid?
>
> What platform and compiler is this?  I'm fairly certain that, according
> to the language specification, sizeof(size_t) == sizeof(void *)...

Really? The ANSI spec explicitly equates sizeof(size_t) to 
sizeof(void*). Interesting...

Just reconfirmed on my platform (OS/400 V5R3 using ILE/C with teraspace 
options enabled to give 8-byte pointers instead of tagged 16-byte 
pointers) and sizeof(void*) = 8 while sizeof(size_t) = 4. It's an 
unsigned int in stddef.h. This platform is LLP64 data model, not LP64.

Regards,
Peter Colson.



More information about the Gc mailing list