[cc65] Best way to get align memory...

Date view Thread view Subject view

From: Christian Krüger (christian.krueger_at_pace.de)
Date: 2003-01-06 18:21:18


Hi,

I like to know which is the best way to reserve a static
buffer with a memory alignment.

Example: I like to have an 1k buffer aligned at a 4 byte
'boundary':

--------8<-------------

#define patchbytes 3	// alignment - 1

unsigned char buffer[1024+patchbytes];
unsigned char* realbuffer = buffer+patchbytes & 0xFFFC;

--------8<-------------

But I do not like the extra pointer and the 3 bytes wasted
memory...
Suggestions for a better method?

Regards
chrisker
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-01-06 18:22:21 CET