From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 630BE7EEF8 for ; Mon, 13 Jul 2015 05:12:33 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oleg@okmij.org) identity=pra; client-ip=66.39.3.114; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of oleg@okmij.org designates 66.39.3.114 as permitted sender) identity=mailfrom; client-ip=66.39.3.114; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail1.g3.pair.com) identity=helo; client-ip=66.39.3.114; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="postmaster@mail1.g3.pair.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AZAQBSLKNVnHIDJ0JbDoNaaQG9M4V3AoEsTAEBAQEBARIBAQEBAQgLCQkhLoQkAQEDATo/BRYNFDQFKIhaBwENx3QBAQEHAgEfi0yCa4IbBxaDAYEUBY0bhxaBNYM0hxqCBWyVe4NjTWCCSwEBAQ X-IPAS-Result: A0AZAQBSLKNVnHIDJ0JbDoNaaQG9M4V3AoEsTAEBAQEBARIBAQEBAQgLCQkhLoQkAQEDATo/BRYNFDQFKIhaBwENx3QBAQEHAgEfi0yCa4IbBxaDAYEUBY0bhxaBNYM0hxqCBWyVe4NjTWCCSwEBAQ X-IronPort-AV: E=Sophos;i="5.15,459,1432591200"; d="scan'208";a="169987160" Received: from mail1.g3.pair.com ([66.39.3.114]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 13 Jul 2015 05:12:32 +0200 Received: from Magus (96.72.239.49.rev.vmobile.jp [49.239.72.96]) by mail1.g3.pair.com (Postfix) with ESMTPSA id BAF1C3410B; Sun, 12 Jul 2015 23:12:28 -0400 (EDT) Date: Mon, 13 Jul 2015 12:20:23 +0900 From: Oleg To: mwh@cs.umd.edu Cc: caml-list@inria.fr Message-ID: <20150713032023.GA694@Magus> Mail-Followup-To: Oleg , mwh@cs.umd.edu, caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Subject: Re: [Caml-list] Scanning objects outside the OCaml heap > 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.