🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2234

Re: Question on DATA STRUCTURES

#2234
From: Ari Lukumies
Date: Mon, 11 Mar 1996 12:28
23 lines
1335 bytes
Joe wrote:
> 
> In article <4hgc4i$98q@solutions.solon.com>, walter briscoe wrote:
> >} LETTER_TYPE; /* I have found that list pointers are better placed
> >               ** at the beginning of structs than the end. */
> 
> Why?
> 
> --jf
> 
> [Because the nearly-legal generic linked list sorter is much faster if
>  it doesn't need to be given an offset?  :) -mod]

Or, looking at the structure definition, it is very soon clear that it implements 
a list. Or, to avoid unnecessary padding when other structure members are of 
shorter types than the current padding scheme. For this reason, I usually write 
structure members so that pointers come first, then the others starting from those 
with longer types to shorter ones.

Later,
 AriL
-- 
All my opinions are mine and mine alone.
Technical Details
Message-ID: <4i1695$gu@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4hdqop$8sd@solutions.solon.com> <4hgc4i$98q@solutions.solon.com> <4hv06p$jbn@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
Newsgroups: comp.lang.c.moderated
Subject: Re: Question on DATA STRUCTURES
Date: 11 Mar 1996 06:28:21 -0600
Organization: Carelcomp Forest
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4i1695$gu@solutions.solon.com>
References: <4hdqop$8sd@solutions.solon.com> <4hgc4i$98q@solutions.solon.com> <4hv06p$jbn@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Mailer: Mozilla 2.0 (WinNT; I)