Objects question..._(re)

Thu, 04 Sep 1997 23:40:26 +0800


At 10:42 4/09/97 -0400, you wrote:
>From: Peter Gerwinski 
>>You are obviously writing a memory manager to keep the amount of RAM
>>...
>>Your application does not even notice this.
>    Sounds like you mean a Virtual Memory Manager, what I'm actually working
>on are the screen objects, and the reason I brought it up is because BP
>loads the object code whether it's needed or not. So basically, GPC loads
>all object code at startup? Or does it load it when it's called with New?

Object Methods are stored, and handled just like normal procedures and
functions - because they are normal procedures and functions! Make a simple
Object type (with a constructor and a procedure method) and compile the
program with the "-S" switch (uppercase). This will produce a ".s" file
containing the assembly listing of your code. If you understand a little
ASM (which you should because you are writing a graphics lib) this will
show you EXACTLY how objects are implemented.

Therefore, GPC loads all object code at startup - just like the rest of the
code. There is NO DIFFERENCE between normal program code and object code.

BTW - Code size is so minimal compared with DATA, I personally dont see ANY
reason for trying to dynamically load code. This is only useful if you are
programming in real mode (like TP) and you are restricted to ~600K of code
and data. GPC executables are only so BIG because there is a HEAP of unused
library code appended to the end (BTW: WHY IS THIS??) - A procedure is
usually not much bigger than 20KB!!

Take a look at my "VGA.DRV" - It contains all the code to the VGA driver -
Its only 5KB in size - CODE IS SMALL!

 ________________________    e-mail: bernie@icenet.com.au
|  _)        | |                     ptschirrenb@cc.curtin.edu.au
|___)ernhard |_|schirren             tschirre@cs.curtin.edu.au
                             www:    www.geocities.com/CollegePark/Quad/8070/


Bernhard Tschirren (bernie@icenet.com.au)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es