caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Nuutti Kotivuori <naked+caml@naked.iki.fi>
To: skaller@ozemail.com.au
Cc: Alain.Frisch@ens.fr, Caml list <caml-list@inria.fr>
Subject: Re: [Caml-list] Freeing dynamically loaded code
Date: Sat, 13 Dec 2003 08:50:19 +0200	[thread overview]
Message-ID: <87zndx5hzo.fsf@naked.iki.fi> (raw)
In-Reply-To: <1071281096.14110.16.camel@pelican> (skaller@ozemail.com.au's message of "13 Dec 2003 13:04:57 +1100")

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


  reply	other threads:[~2003-12-13  6:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-12 19:04 Nuutti Kotivuori
2003-12-12 19:36 ` Alain.Frisch
2003-12-12 20:05   ` Nuutti Kotivuori
2003-12-12 21:26     ` Alain.Frisch
2003-12-12 21:54       ` Nuutti Kotivuori
2003-12-13  7:25         ` Nuutti Kotivuori
2003-12-13  8:15           ` Alain.Frisch
2003-12-13 20:57             ` Nuutti Kotivuori
2003-12-17  7:17             ` Jacques Garrigue
2003-12-17 23:48               ` Nuutti Kotivuori
2003-12-13  2:04       ` skaller
2003-12-13  6:50         ` Nuutti Kotivuori [this message]
2003-12-15  3:11       ` Nuutti Kotivuori
2003-12-17 23:16         ` Nuutti Kotivuori
2003-12-15  9:35 ` Basile Starynkevitch
2003-12-15 11:34   ` Nuutti Kotivuori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zndx5hzo.fsf@naked.iki.fi \
    --to=naked+caml@naked.iki.fi \
    --cc=Alain.Frisch@ens.fr \
    --cc=caml-list@inria.fr \
    --cc=skaller@ozemail.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).