Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #634

Re: memory use

Path csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.190.251.MISMATCH!news-out.readnews.com!transit4.readnews.com!panix!not-for-mail
From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.os.linux.development.apps
Subject Re: memory use
Date Wed, 2 Feb 2011 19:42:08 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 37
Message-ID <iicc2g$h26$1@reader1.panix.com> (permalink)
References <slrnikj71n.9i7.BobT@linus.cs.queensu.ca>
NNTP-Posting-Host dsl.comtrol.com
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace reader1.panix.com 1296675728 17478 64.122.56.22 (2 Feb 2011 19:42:08 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Wed, 2 Feb 2011 19:42:08 +0000 (UTC)
User-Agent slrn/pre0.9.9-102 (Linux)
Xref csiph.com comp.os.linux.development.apps:634

Show key headers only | View raw


On 2011-02-02, Bob Tennent <BobT@cs.queensu.ca> wrote:

> A C program called musixflx is used as the second pass of a
> three-pass TeX-based system called musixtex.  The program was the
> first C program written by a Fortran programmer.  It has definitions
> as follows:
>
>   # define MAX_BARS    2048  /* max number of bars */
>
>   int zbar[MAX_BARS], lr_repeat[MAX_BARS], raggedline[MAX_BARS],
>       l_repeat[MAX_BARS], barno[MAX_BARS], ...
>
>   double hardbarlength[MAX_BARS], softbarlength[MAX_BARS],
>          width_leftrightrepeat[MAX_BARS], width_leftrepeat[MAX_BARS],
>          ...
>
> Typically the number of bars in a piece is much smaller than MAX_BARS.
>
> Would it be best to
>
>  + leave the code alone and let the virtual-memory functions of the
>    operating system manage the memory
>
>  + use "extensible" arrays (i.e., use realloc to copy small arrays to
>    larger ones when necessary)
>
> And would there be any benefit to using a single array of structures
> instead of many parallel arrays?

You're going to have to define "best" and "benefit" before anybody can
attempt to answer your question.  Is the current design causing some
sort of problem for you?  If so, what is that problem?

-- 
Grant Edwards               grant.b.edwards        Yow! In Newark the
                                  at               laundromats are open 24
                              gmail.com            hours a day!

Back to comp.os.linux.development.apps | Previous | NextNext in thread | Find similar


Thread

Re: memory use Grant Edwards <invalid@invalid.invalid> - 2011-02-02 19:42 +0000
  Re: memory use Grant Edwards <invalid@invalid.invalid> - 2011-02-02 21:16 +0000
  Re: memory use Bob Tennent <BobT@cs.queensu.ca> - 2011-02-02 20:22 +0000

csiph-web