[comp.sys.amiga.programmer] Unloading hunks

rosenber@ra.abo.fi (Robin Rosenberg INF) (02/22/91)

I wonder...
In some applications there is code that is needed only once, such as
initialization code. Assuming that code located into one or more hunks
of their own, is it then _legal_ to unlink these hunks from the segment
list and simply FreeMem() the hunks?

-----
	Robin

micja@IDA.LiU.SE (Michael Jansson) (02/22/91)

In article <ROSENBER.91Feb21193450@ra.abo.fi> rosenber@ra.abo.fi (Robin Rosenberg INF) writes:
>
>I wonder...
>In some applications there is code that is needed only once, such as
>initialization code. Assuming that code located into one or more hunks
>of their own, is it then _legal_ to unlink these hunks from the segment
>list and simply FreeMem() the hunks?
>
>-----
>	Robin

I think you can achieve the same result by using a c-compiler that can
manage segments (hunks). I think that at least Manx can put files in
certain hunks which can either be loaded when needed or loaded/freed on
demand. I guess that the compiler or some linker library are doing what you
suggest, so it ought to be _legal_. They (Manx) probably use FreeSeg (or
is it called UnloadSeg?) rather than FreeMem.


- Michael

PS: I have not actually tried it so this is only speculations. Please let
me know if it works.


--
##########################################################
#   Michael Jansson             |   \_/
#   Internet: mij@IDA.LIU.SE    |    V                   _|_
#   UUCP: uunet!liuida!mij      |    |    Absolut Software|
#   BITNET: mij@SELIUIDA        |   ~~~