Objects question..._(re)

Thu, 4 Sep 1997 16:24:35 +0200



Peter Gerwinski wrote:

> > Is there a way to
> > create an object so that it will be loaded only if allocated with "New"? In
> > other words, is there a way to keep the code for the object on disk until
> > it's needed, and removed form memory when not?
> 
> Write a constructor that fetches all needed data from the file when
> the object is `New'ed; if you want to keep the stuff in the file
> current, write a destructor that writes everything back to disk
> when the object is `Dispose'd.  (* BTW, this has nothing to do with
> the internals how objects work at run-time. ;*)
 
I think he meant dynamically loading and freeing the code of the object's
method, not it's data. AFAIK, one needs to use dynamic linking in order to
achieve this, but I don't know much about it.

> You are obviously writing a memory manager to keep the amount of RAM
> your program uses small and to use the disk instead.  On UNIX-like
> platforms you don't need to do this because the operating system does
> it for you.

BTW: Do DJGPP and/or EMX do this, too?

Frank

-- 
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
http://home.pages.de/~fjf/links.htm


Frank Heckenbach (heckenb@mi.uni-erlangen.de)

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