Re: Promoting unsigned long int to long int
- From: pete <pfiland@xxxxxxxxxxxxxx>
- Date: Mon, 30 Jun 2008 13:10:55 -0400
pereges wrote:
If I had to store 80-90 of structures and each had a member say
'axis'. How much of a difference would using a unsigned char over int
would make (for that member) ? For my program, space as well as
performance are important.
On my machine it would make
no difference in terms of usable memory saved
and it would slow down the arithmetic operations.
An array of char will save usable space over an array of int;
but if I only define several distinct char objects in a function,
my compiler will place them on int boundaries.
Meaning that in between the char objects,
there are three bytes of unusable memory
(sizof(int) equals 4 on my machine).
char arithmetic on my machine
is accomplished in int size objects or registers,
requiring additional masking operations.
--
pete
.
- Follow-Ups:
- Re: Promoting unsigned long int to long int
- From: pereges
- Re: Promoting unsigned long int to long int
- References:
- Promoting unsigned long int to long int
- From: pereges
- Re: Promoting unsigned long int to long int
- From: Keith Thompson
- Re: Promoting unsigned long int to long int
- From: pereges
- Re: Promoting unsigned long int to long int
- From: Keith Thompson
- Re: Promoting unsigned long int to long int
- From: pereges
- Promoting unsigned long int to long int
- Prev by Date: Re: problem passing pointer array
- Next by Date: Re: problem passing pointer array
- Previous by thread: Re: Promoting unsigned long int to long int
- Next by thread: Re: Promoting unsigned long int to long int
- Index(es):
Relevant Pages
|