www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/08/05:14:06

Date: Mon, 8 May 1995 08:41:12 +0300
From: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
To: rdc AT freenet DOT vancouver DOT bc DOT ca
Subject: Re: Int's need to be on paragraph boundaries?
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

>  IE: I want to 'pack' for space considerations and 'unpack' for speed.
>    ...  or ... would I need _two_ different arrays and move bytes between 
> (slow and defeats any 'gains') ... (No sparse MAT code please ;> ).

In most cases, unless you have HUGE arrays of such structures, or have to
process the structure in the innermost hottest loop, these considerations
never apply.  So I would say, if you have to match a struct to some external
item (like a disk file or hardware device), use __attribute__((packed)).  At
least this documents that something unusual is going on.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019