From: oleg@okmij.org
To: christophe.raffalli@univ-savoie.fr
Cc: caml-list@inria.fr
Subject: [Caml-list] Re: Closures serialization and hash.
Date: 16 Apr 2013 07:17:30 -0000 [thread overview]
Message-ID: <20130416071730.92921.qmail@www1.g3.pair.com> (raw)
> - use a table associating function "names" (position in the .cmo, or the
> lambda-tree or anything
> portable) to source code adresses. The function name should be portable
> across architecture and
> distinct binary using common librairies.
>
> - (1) fill this table by calling a function "register_code_pointer : ('a ->
> 'b) -> unit"
>
> - (2) or even better offer a linking option to register all closures from
> some compilation unit.
Incidentally delimcc has to do something similar when serializing
captured byte-code delimited continuations. Delimcc has a function
to register a closure, unimaginatively named
val register_global_closure : ('a -> 'b) -> unit
It also provides a third way of registration. The function
val relativitize : Obj.t -> bool -> Obj.t
takes an object (usually a closure, but can be anything), and, when
called with with true as the second argument, registers all closures
found during the traversal of the object (provided they are in the old heap --
there is little sense to register closures that are transient). Sec 8
of
http://okmij.org/ftp/continuations/caml-shift-journal.pdf
explains what relativitize (and the dual, absolutize) do and
especially why they are needed.
reply other threads:[~2013-04-16 7:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20130416071730.92921.qmail@www1.g3.pair.com \
--to=oleg@okmij.org \
--cc=caml-list@inria.fr \
--cc=christophe.raffalli@univ-savoie.fr \
/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