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


Groups > comp.os.msdos.programmer > #870

Re: Borlands TLINK and minimizing an EXEs memory usage

From Ross Ridge <rridge@csclub.uwaterloo.ca>
Newsgroups comp.os.msdos.programmer
Subject Re: Borlands TLINK and minimizing an EXEs memory usage
Date 2013-04-04 19:51 -0400
Organization University of Waterloo
Message-ID <kjl3me$66o$1@rumours.uwaterloo.ca> (permalink)
References <515c94db$0$6871$e4fe514c@news2.news.xs4all.nl> <515da12f$0$6978$e4fe514c@news2.news.xs4all.nl> <kjkofd$c11$1@rumours.uwaterloo.ca> <515e01e0$0$6904$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


Ross Ridge writes:
> The correct way to handle this is let the EXE allocate all of
> memory at startup and then resize this allocation to what you
> actually need.

R.Wieser <address@not.available> wrote:
>I disagree.   The *correct* way is to have the .EXE header mention how much
>your program needs, and let exactly that ammount be allocated for it by the
>OS.

Standard practice is to resize the initial allocation.  You haven't
suddenly discovered some better way of doing things, you're just repeating
old mistakes.

>> Otherwise you're just putting some value in to the EXE
>> header that you're going to need to adjust everytime you
>> make a change to your program.
>
>Just like I need to convert the sourcecode to an .EXE every time ? :-)

No.  It's something you need to either calculate manually or write a
new program to calculate for you.  You might as well add the small bit
of code to your EXE and do it properly.  Then it becomes no different
than how your source code is converted to an EXE, because it is part of
your source code that's converted to an EXE.

>But its looks quite straight-forward: after having link done its job just
>let another (very small) program copy the WORD from offset 000Ah to 000Ch
>(making maxalloc equal to minalloc) and the job is done.

You're assuming that the minalloc value that the linker comes up with is
the correct value.  Resizing the initial allocation is also how you ensure
that the actual minimal amount of memory your program needs is available.

					Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge@csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/~rridge/ 
 db  //	  

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-03 22:46 +0200
  Re: Borlands TLINK and minimizing an EXEs memory usage Bogus@Embarq.com (Steve) - 2013-04-04 12:51 +0000
    Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-04 17:51 +0200
      Re: Borlands TLINK and minimizing an EXEs memory usage Ross Ridge <rridge@csclub.uwaterloo.ca> - 2013-04-04 16:40 -0400
        Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-05 00:43 +0200
          Re: Borlands TLINK and minimizing an EXEs memory usage Ross Ridge <rridge@csclub.uwaterloo.ca> - 2013-04-04 19:51 -0400
            Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-05 11:50 +0200
              Re: Borlands TLINK and minimizing an EXEs memory usage Bogus@Embarq.com (Steve) - 2013-04-05 12:21 +0000
                Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-05 16:02 +0200
              Re: Borlands TLINK and minimizing an EXEs memory usage Ross Ridge <rridge@csclub.uwaterloo.ca> - 2013-04-05 20:56 -0400
                Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-06 12:37 +0200
                Re: Borlands TLINK and minimizing an EXEs memory usage JJ <jaejunks@nah.meh> - 2013-04-06 21:10 +0700
                Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-06 19:38 +0200
                Re: Borlands TLINK and minimizing an EXEs memory usage Ross Ridge <rridge@csclub.uwaterloo.ca> - 2013-04-07 02:34 -0400
                Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-07 19:55 +0200
                Re: Borlands TLINK and minimizing an EXEs memory usage Ross Ridge <rridge@csclub.uwaterloo.ca> - 2013-04-07 16:07 -0400
                Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-08 00:32 +0200
                Re: Borlands TLINK and minimizing an EXEs memory usage Bogus@Embarq.com (Steve) - 2013-04-08 12:52 +0000
                Re: Borlands TLINK and minimizing an EXEs memory usage rugxulo@gmail.com - 2013-04-08 14:15 -0700
  Re: Borlands TLINK and minimizing an EXEs memory usage "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-07 20:20 -0400
    Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-08 12:48 +0200
      Re: Borlands TLINK and minimizing an EXEs memory usage JJ <jaejunks@nah.meh> - 2013-04-09 09:12 +0700
        Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-09 12:47 +0200
    Re: Borlands TLINK and minimizing an EXEs memory usage Ross Ridge <rridge@csclub.uwaterloo.ca> - 2013-04-08 20:17 -0400
      Re: Borlands TLINK and minimizing an EXEs memory usage "R.Wieser" <address@not.available> - 2013-04-09 12:28 +0200

csiph-web