<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/12/be509fa3a919a5e8efb6a28c92bb384e"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-13T06:50:24"
  subject="Re: [Caml-list] Freeing dynamically loaded code"
  prev="2003/12/b27fe723d723ccd52a027df72e683a76"
  next="2003/12/de2a57cea59abdba26c046de1d0a57d0"
  prev-in-thread="2003/12/294e6e26a75ec5a94aec065cd022d938"
  next-in-thread="2003/12/2d9430335faaca17eba81d2c109937ca"
  prev-thread="2003/12/d1e1de7970b7af2882a64e70200b90ab"
  next-thread="2003/12/68276101f2bc192b44f47bce0bf1c103"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/c8b08257908c25043521e0a3fe5eaa77"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-12T19:04:32"
  subject="[Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/0c7decba295f699bda078d6318fb9445"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-12-12T19:36:48"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/93987d0010b1b77d46ffdd8b42e9ddb6"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-12T20:05:51"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/0b0cbd59b0fdc2fb5469101f41b02c0d"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-12-12T21:26:50"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/ccc55211ed05144411fb273907604dfc"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-12T21:55:00"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/de2a57cea59abdba26c046de1d0a57d0"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-13T07:25:41"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/89f22e8743e7c03c963e920443aafb34"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-12-13T08:15:58"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/17b689cbb8f6dc1d21d31abd0ae53371"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-13T20:57:35"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
</msg>
<msg 
  url="2003/12/e8b6acc35d8fa6020be206659a0b8e6f"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-12-17T07:17:47"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/f6e4f3915780cad48789ef64a0624577"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-17T23:48:37"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/12/294e6e26a75ec5a94aec065cd022d938"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-12-13T03:05:14"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/be509fa3a919a5e8efb6a28c92bb384e"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-13T06:50:24"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
</msg>
</msg>
<msg 
  url="2003/12/2d9430335faaca17eba81d2c109937ca"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-15T03:11:26"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/ea2a721b6ed22c6404d67bc1566cc56e"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-17T23:17:03"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/12/d48b5541e82f7a6160b744399b9e7b12"
  from="Basile Starynkevitch &lt;basile.starynkevitch@i...&gt;"
  author="Basile Starynkevitch"
  date="2003-12-15T09:35:21"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
<msg 
  url="2003/12/d1b02bef80190b6a892c1eb4d2c74bff"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-15T11:34:52"
  subject="Re: [Caml-list] Freeing dynamically loaded code">
</msg>
</msg>
</msg>
</thread>

<contents>
skaller@ozemail.com.au wrote:
&gt; That is not enough. It is not necessary for some code to be
&gt; active in order that it may later *become* active as
&gt; a result of a subroutine call or jump. It would be necessary
&gt; to find all code addresses and which blocks they point to,
&gt; and build a dependency graph, and add the roots of that graph
&gt; to the gc memory graph as well.
&gt;
&gt; Otherwise, after you say
&gt;
&gt; 	#load xxxx
&gt;
&gt; the collector would immediately free it :-)

Actually no. The way to access code that is not "active" as you say,
is through global variables. Eg. if you do

   #load "test.cmo"

then there's an entry Test in the global table that holds pointers for
all functions defined in that file. And the global table is inside the
ocaml heap, so those all will be referenced.

The only way for that to become unloaded is that the global Test is
replaced or removed by something - either by some unload module or
loading a newer source on top of it - and then no references point to
Test. And if no references point to the file, it really cannot be
accessed anymore by any means, and hence can be removed.

Ofcourse, right now there might be also other external references to
the code in the heap, I am not sure - but those would have to be
either removed or made Weak somehow. But that is to be solved after
this immediate problem is resolved.

-- Naked

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

