From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105])
by yquem.inria.fr (Postfix) with ESMTP id 35CFABC57
for ; Tue, 7 Sep 2010 23:24:33 +0200 (CEST)
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AjQBAMZKhkzRVdQ0imdsb2JhbACDGZ1nCBUBAQEKCQwHDwUfpl6IdzyCFYZWLogDAQEDBYEdgyd0BIoY
X-IronPort-AV: E=Sophos;i="4.56,330,1280700000";
d="scan'208";a="69028815"
Received: from mail-vw0-f52.google.com ([209.85.212.52])
by mail4-smtp-sop.national.inria.fr with ESMTP; 07 Sep 2010 23:24:15 +0200
Received: by vws14 with SMTP id 14so6012572vws.39
for ; Tue, 07 Sep 2010 14:24:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:mime-version:received:in-reply-to
:references:from:date:message-id:subject:to:content-type
:content-transfer-encoding;
bh=YXvpQNXlSLuFT0CjOAOI/HVxTmgW+d0Xi39p4fji4Uk=;
b=RZmnchCcbLKIMarVtN/Z6qGK99ME5qayg6psU3nA25MM3rMIJNwvVHlCS32zlgQWkn
8tis9WJhvJAhc27fWW+K+b3/mXIqtSa75r1Nh45MijTwO4iN4Rvl7cmufvltoiwlqR9V
EuE4v6TNq02YyiGFrAuQY0Gw6zOj//J0X17qs=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type:content-transfer-encoding;
b=UqXd6u6qpNHLCeyB7h6rpXlJlVlpRaxegaQLPa+uMs7GSGuzBK9uCiBmRtERkU+mEl
q42LGSeRrXViynyGVo4hSEa1iuiWoG3hfRRWkdMHzKFyxLg4RJWCX1wF8wkHI+l05xMA
n4+k6rg6wSkEuXAjFXrhIHT6Kwlzg2Y1Dpn2M=
Received: by 10.220.71.136 with SMTP id h8mr7793vcj.135.1283894654210; Tue, 07
Sep 2010 14:24:14 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.95.210 with HTTP; Tue, 7 Sep 2010 14:23:54 -0700 (PDT)
In-Reply-To: <4C86AABC.3010501@glondu.net>
References: <4C86AABC.3010501@glondu.net>
From: Paolo Donadeo
Date: Tue, 7 Sep 2010 23:23:54 +0200
Message-ID:
Subject: Re: [Caml-list] C binding and GC interaction: storing values outside
the heap
To: OCaml mailing list ,
OCaml-Lua devel ML
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam: no; 0.00; segfault:01 phane:98 W6:98 wrote:01 heap:01 caml-list:01 finalization:01 caml:02 interaction:02 binding:02 root:04 root:04 solved:04 tue:06 sep:06
On Tue, Sep 7, 2010 at 23:12, St=C3=A9phane Glondu wrote:
> Why don't you call caml_register_global_root on &(data->state_value) as w=
ell?
This was a solution I tried, but with the additional global root the
finalization function was never called by the GC, so it solved the
segfault with a memory leak :-)
--=20
Paolo =E2=A0=A0=E2=A0=B5