From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p35F3dw8005640 for ; Tue, 5 Apr 2011 17:03:39 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnwBAJYum03RVdg2kGdsb2JhbACES5NkhjoBhncIFAEBAQEJCQ0HFAQhiHmfKYoqPIIjhG0wiF0BAQMFhG94BIF7igiBIocRgg06 X-IronPort-AV: E=Sophos;i="4.63,304,1299452400"; d="scan'208";a="80250959" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Apr 2011 17:03:33 +0200 Received: by qwc9 with SMTP id 9so467894qwc.27 for ; Tue, 05 Apr 2011 08:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=veSPDxwYn5pfwI0zEGmRwmwxXqnGqpz49vXx2RtWpLo=; b=kGRxDEIC3vUeCA0NkrFqRnixDN7RhvgLAUYON8oPNX/+NxYilTSTfB667BFUKxZSca rPP71N9lTNxWGCNa3qcxfua1/NxUfFKvSC3PYAdycCBQSejztZaafPV+EuPiZkUyBBq9 5OGQIIm/R68kIYY4khjbMJNbZoC9KpypSUMvA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=KmYi4jkVj+JEyHN8e0FggJsnhUp9kTHHTT93ACiRAyt+qaNDVdpADuTDwZAWHG6gfQ hX8WhpevLMKGrSx2ewvhi+aNjsl4og8HEPOf7fhdLlAeYCOyz6czEF/kRose2qTC2tQO lsqa+HiTu6mz067GqEltOXgc7XPuDp0L7MeCc= MIME-Version: 1.0 Received: by 10.229.7.3 with SMTP id b3mr6901553qcb.194.1302015812254; Tue, 05 Apr 2011 08:03:32 -0700 (PDT) Received: by 10.229.65.21 with HTTP; Tue, 5 Apr 2011 08:03:32 -0700 (PDT) In-Reply-To: References: Date: Tue, 5 Apr 2011 11:03:32 -0400 Message-ID: From: Niki Yoshiuchi To: Pedro Borges Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=0015175d014cfb409604a02d2d56 Subject: Re: [Caml-list] C bindings and Gc.compact --0015175d014cfb409604a02d2d56 Content-Type: text/plain; charset=UTF-8 The manual has a section on just this issue, although the manual can be a little confusing at times: http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc140 Sylvain Le Gall already mentioned the basics - registering the values with the garbage collector using CAMLparam (and then releasing them with CAMLreturn) prevents any problems. Also local values should be declared using CAMLlocal and global values should be registered using caml_global_register_root. On Tue, Apr 5, 2011 at 7:27 AM, Pedro Borges wrote: > Hi, everyone, > > If a compactification is triggered do the values get rewritten or do > they become invalid? > > > Best Regards, > > Pedro Borges > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > --0015175d014cfb409604a02d2d56 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The manual has a section on just this issue, although the manual can be a l= ittle confusing at times: http://caml.inria.fr/pub/docs/manual-ocaml/manu= al032.html#toc140

Sylvain Le Gall already mentioned the basics - registering the values w= ith the garbage collector using CAMLparam (and then releasing them with CAM= Lreturn) prevents any problems.=C2=A0 Also local values should be declared = using CAMLlocal and global values should be registered using caml_global_re= gister_root.

On Tue, Apr 5, 2011 at 7:27 AM, Pedro Borges= <pdhb.lists@g= mail.com> wrote:
Hi, everyone,

If a compactification is triggered do the values get rewritten or do
they become invalid?


Best Regards,

Pedro Borges

--
Caml-list mailing list. =C2=A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


--0015175d014cfb409604a02d2d56--