| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Practicality |
BB> While all this kerfuffle about string storage is all
BB> very interesting academically, does it have any practical
BB> application?
I was reading the source code of a compiler (of all things) and noticed
a construct like
char *c1[] = {"I", "forgot", "the",
"exact", "verbiage"};
used several times. I know from experience that trying to write to such
a construct is undefined and the results are unpredictable (works with
Borland but bombs with Microsoft). At that time the question came into
my head. My question was just a curiosity, nothing more.
BB> We have done our best to answer your questions, but my
BB> question to you is - what difference does it make?
To me, none because I normally use the much more conservative (and time
consuming) approach of dutifully mapping out an area of memory, using it
and then disposing of it.
BB> If it is as I suspect, and then only if you are confident enough
BB> of your own carefulness in programming, you should break the
BB> program down into separate modules and use an overlay
BB> linker to reconnect the modules dynamically. This will
BB> result in redundant string space not only going out of
BB> scope, but also being cleared out of memory by the overlay
BB> loader. Is that what you were after? The practice is not
BB> actually dangerous, it just requires care and is a bit old-
BB> fashioned now, because it has largely been superseded by
BB> DLLs.
In fact I DO use DLLs. I haven't done any embedded programming in the
last seven years. The reason that I have never considered using
overlays in embedded systems is that if a system were large enough, it
probably wouldn't fit anywhere in memory, anyway. The embedded systems
with which I worked had no mass storage devices. Programs were kept in
EEPROMS and data was held in static memory (which was _really_ scarce).
BB> I can see applications in embedded programs where
BB> memory is limited and linear, but I thought that the
BB> hardware revolution had caught up even there.
There resources required for storing the overlay manager weren't there.
þ CMPQwk 1.42 999
--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)SEEN-BY: 633/267 270 @PATH: 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.