| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | A few questions |
G'Day Paul,
-=> Quoting Paul Wankadia to Frank Adam <=-
PW> Ahhh... Now THAT'S what I'm not doing -- LARGE model, you say? I'm
I always code in large, and then reduce the model if warranted, large is a
lot more stable than small for testing or developing code.
But for grpahics you have to be in LARGE model.
PW> still trying to come to terms with the memory-hog I call SMALL model...
PW> TINY is getting too small now, so it's upto SMALL model, which likes
PW> to take > 100Kb at times...
You may have too many static variables.
Let's say you have struct fred[100]; and sizeof(fred) = 100 bytes.It'll
end up in the exe as 10000 bytes of nothing.Not counting the pointers.
I knew there was something wrong with using too many globals.:-)
PW> BTW with SMALL model (producing a COM file), is there any code I can
PW> type in that will deallocate all the memory the program is not using.
I belive you can't make a.com file with small model.
Tiny creates the one 64K segment, and your code and data is within
that, small creates two 64k segments,a data segment and a code segment.
AFAIK, COM files are limited to 64K, so i presume they're not allowed to
have more than one segment.
That's the way i understand it, but i'm quite prepared to be corrected.
PW> E.g. I have programmed in Rowan Crowe's MoonRock -- I can make my
PW> programs only use (say) 35Kb. Yet, with Turbo C++ v3.0, ALL programs
PW> take 66Kb (SMALL model), even if I'm not using all of it... How can I
I haven't seen it, but perhaps you're trying to make MoonPebble out of
MoonRock ?
Why not ask Rowan about it ?:-)
PW> deallocate the extra bit in code?
You can start by switching off the class(? can be done in BC4) but
definitely the graphics library if you don't use it.
I always thought, smart compilers would strip the code not being used, but
i may be wrong on that. Safest way is to either "rem out" the stuff,
or remove it completely.
Also you can tell the compiler to optimize for size or speed.
Finally try and tighten up the code, using Tprof if you have to.
L8r Frank (fadam{at}ozemail.com.au).
___ Blue Wave/DOS v2.21
---
* Origin: Melbourne PC User Group BBS (3:632/309)SEEN-BY: 3/103 50/99 620/243 623/630 632/50 107 108 309 348 360 371 504 525 SEEN-BY: 632/530 533 562 633/371 634/388 396 635/301 502 503 544 728 639/252 SEEN-BY: 711/409 410 413 430 808 809 932 934 712/515 713/317 714/906 800/1 @PATH: 632/309 107 635/503 50/99 711/808 934 |
|
| 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™.