Subject: Re: amd64 stable for production ?
To: None <netbsd-users@NetBSD.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-users
Date: 12/11/2006 16:37:58
Christian Biere wrote:
> Consider the usual suspects like lists, hashtables and such. Since in C
> these are typically pointer- not index-based they'll be twice as large
> on a 64-bit architecture.

P.S.: Structures suffer from this as well if people ignore alignment
requirements and interleave int and pointers in the struct layout. For
example in cases as this:

struct blah {
	int foo;
	void *bar;
	int baz;
};

On a 32-bit machine this is typically 3*4 bytes large. On a 64-bit machine it
grows to 2*4 + 8 + 4 (pad) bytes and potentially another 4 bytes trailing
structure padding. If you rearrange it - something the compiler is not allowed
to do - it can be decreased to 16 bytes.

-- 
Christian