Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Oleg <oleg@okmij.org>
To: mwh@cs.umd.edu
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Scanning objects outside the OCaml heap
Date: Mon, 13 Jul 2015 12:20:23 +0900	[thread overview]
Message-ID: <20150713032023.GA694@Magus> (raw)
In-Reply-To: <CAFb7wiWQe21EXdeGXjZk+iKKsXYDDY43YET3AQ8oY19xEWQaEw@mail.gmail.com>


> Does anyone know: Is there any way to make outside memory scannable by the
> GC?

The library of delimited control delimcc

        http://okmij.org/ftp/continuations/caml-shift.tar.gz

in native mode has to perform a custom scan of pieces of memory stored
outside the OCaml heap. Captured delimited continuation is essentially
a portion of stack. Native OCaml uses stack for boxed and unboxed
values. Thus the captured continuation is a curious data structure
that contains both boxed (OCaml) and unboxed (machine) values. Delimcc
stores captured continuation outside the OCaml heap and has to scan
them at GC time.

The file stacks-native.c in caml-shift.tar.gz shows how the
interaction with GC is done. BTW, when installing a new GC call-back,
don't forget the previously installed one.

      parent reply	other threads:[~2015-07-13  3:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 22:21 Michael Hicks
2015-07-07  0:32 ` Pierre Chambart
2015-07-13  3:20 ` Oleg [this message]

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=20150713032023.GA694@Magus \
    --to=oleg@okmij.org \
    --cc=caml-list@inria.fr \
    --cc=mwh@cs.umd.edu \
    /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