Re: How to use a gpointer?

On Fri, Mar 05, 1999 at 02:52:20PM +0100, Ulric Eriksson wrote:

> To settle this once and for all, wouldn't it be a good idea to simply
> replace "typedef int gint" with "typedef gint32 gint" in glib.h?

C standard (as I remeber, been C++ hacker for eternity ;-) says that int
supose to be the prefered size of integer type on the system. That mens
not only the processor but the complet system is faster with memory
transfer cost and all. If a 64bit int makes sens 64 bit void * will
probably also make sens (even if the adress space hardly be neded ;-).
So sizeof(int) <= sizeof(void *) is likly to hold exept for werry
exotic systems that can be handled as found. Defining gint as gint32
may be unnasasary suboptimal on a system that actuly is faste with 64
bit ints and use 64 bit void *.

OTOH cross platform applikation can't rely on an int to be biger then
32 bit for a good while longer. That men defining gint as gint32 will
only be potensial suboptimal - not a disaster ;-) in short terms.


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