Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #638
| Path | csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!news.albasani.net!not-for-mail |
|---|---|
| From | Bob Tennent <BobT@cs.queensu.ca> |
| Newsgroups | comp.os.linux.development.apps |
| Subject | memory use |
| Date | Wed, 2 Feb 2011 18:02:31 +0000 (UTC) |
| Organization | albasani.net |
| Lines | 28 |
| Message-ID | <slrnikj71n.9i7.BobT@linus.cs.queensu.ca> (permalink) |
| Reply-To | rdtennent@gmail.com |
| X-Trace | news.albasani.net JgZabWjNESttxT0wDNod5U0K73G+BtDYBKwUKvU3NgVOHpy2xF07Pj5YOHwfhlbkHnh1YogKSU/U4Dfl/1eWhw== |
| NNTP-Posting-Date | Wed, 2 Feb 2011 18:02:31 +0000 (UTC) |
| Cancel-Lock | sha1:rBfwpk2BLJJeKEco0FU0FIntr6M= |
| User-Agent | slrn/0.9.8.1pl1 (Linux) |
| Injection-Info | news.albasani.net; logging-data="XyrQy5hriYEAdG9hLA6i2OzwQ+01qRK0DuAsCoSxKBxWg3o7nu93FTtt1fVW/YxJxZE6AqWRc59Hs07No5nnGmvfJA76UywgoVp96WtuPTOR+urvgWcpR4uDyzndkrCU"; mail-complaints-to="abuse@albasani.net" |
| Xref | csiph.com comp.os.linux.development.apps:638 |
Show key headers only | View raw
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?
Bob T.
Back to comp.os.linux.development.apps | Previous | Next | Find similar
memory use Bob Tennent <BobT@cs.queensu.ca> - 2011-02-02 18:02 +0000
csiph-web