16-byte memory align requirement lazarus / 8-Other ---------------------------------------------------------------------- scribly · 2009-02-12 21:02 I need to call a routine that is really picky about the pointer being 16-byte aligned Is there a way in the ide settings or compile setting parameters to force 16-bit alignment (or better, just specify that particular structure to be on an address that is 16-byte aligned) I guess I could allocate +12 bytes and then shift the pointer address so it is aligned and make sure to free the right pointer base when done... Or use windows' Virtualalloc which always returns a whole page But it'd be nice if that wasn't necesary Function in question is windows 64's: GetThreadContext and SetThreadContext ---------------------------------------------------------------------- Phil · 2009-02-12 21:12 I assume you're referring to a CONTEXT record? See the FPC prog.pdf and search for "align" and "packed". Thanks. -Phil ---------------------------------------------------------------------- scribly · 2009-02-12 22:55 Thanks, I tried {$PACKRECORDS 16} but it still allocated the context structure on a 8 byte boundary, including the elements in it. (bug?) anyhow, i'll just go with the offset shift and just deal with it specifically in the constructor and destructor of the class that uses it ---------------------------------------------------------------------- felipemdc · 2009-02-16 12:20 You should post this question in the Free Pascal mailling list. You will get better answers there.