G_LONG_TO_POINTER possible



Hi!

I'm new to this mailing list. I'm using Glib in developing an IPC library. Browsing the API spec, I realized that macros to store longs in pointers are possible, which is a benefit under 64-bit Linux.

Under 64-bit Linux,
sizeof(int) = 4,
sizeof(long) = sizeof(gpointer) = 8.

Under 64-bit Windows (AFAIK),
sizeof(int) = sizeof(long) = 4,
sizeof(gpointer) = 8.

A long is never bigger than a pointer. Specifically, read about the "64 bit data model":

http://www.unix.org/whitepapers/64bit.html

Cheers,
Tom Weber



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]