[clug] Looking for Linux on CBE programming expert help
david at tulloh.id.au
Sat Aug 29 12:11:24 MDT 2009
It was bugging me, so I'm going to clear this up.
David Tulloh wrote:
> (char*) p1 += (memory_t) p1 % 128;
> I've introduced memory_t here as a data type to represent memory for
> the system. The SDK should provide an appropriate type for this, it's
> probably called something different. The size of this variable should
> be chosen with reference to the amount of memory supported and the
> native datatype of the processor. Using int is often a bad idea in my
> book, but here doubly so. If int is 32 bits you have limited yourself
> to 4 gigs of memory, if it's 16 bits you are in deep trouble.
uintptr_t is the ISO standard type for what I referred to as memory_t.
Unfortunately it's presence is optional.
More information about the linux