Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Freeing dynamically loaded code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-13 (03:05)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] Freeing dynamically loaded code
On Sat, 2003-12-13 at 08:26, wrote:
> On Fri, 12 Dec 2003, Nuutti Kotivuori wrote:
> > Well, like Xavier Leroy said at the end of the mail - *he* probably
> > isn't doing it. That doesn't mean there wouldn't be someone else crazy
> > enough to try :-)
> >
> > And atleast I'm not dropping the investigation just yet.
> Thinking again about the technical challenge (put the dynlink'ed code
> under GC control), I think the following approach is worth a try.
> The question is how to let the GC know that the code block cannot be freed
> as long as there is some accessible closure pointing into this block.

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 :-)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: