0 or 0L for empty pointers?

Michael Buesch mb at bu3sch.de
Wed Jun 21 10:19:03 BST 2006


On Wednesday 21 June 2006 11:07, Brad Hards wrote:
> On Wednesday 21 June 2006 07:15 am, Michael Buesch wrote:
> > sizeof(long)==sizeof(void*) is an assumption in the linux kernel, at least.
> > So it is true for all archs which are supported by linux.
> I'm not sure you can safely assume that userspace and kernel space are the 
> same. I vaguely remember that sparc or mips has 64 bit kernelspace and 32 bit 
> userspace.

Sure. But the assumption is still valid.
The assumption in linux is exactly as follows:

sizeof(kernel long) == sizeof(kernel void *)
sizeof(user long) == sizeof(user void *)
sizeof(kernel long) maybe!= sizeof(user void *)

PPC64 generally has a 64bit kernel and 32bit userspace, because
32bit ppc code is faster.
I think sparc is similiar, but I don't know of the reasons.
Mips, well. I never saw a mips64 machine. Do they exist?

-- 
Greetings Michael.




More information about the kde-core-devel mailing list