From: "Stéphane Glondu" <steph@glondu.net>
To: Paolo Donadeo <p.donadeo@gmail.com>
Cc: OCaml mailing list <caml-list@yquem.inria.fr>,
OCaml-Lua devel ML <ocaml-lua-devel@lists.forge.ocamlcore.org>
Subject: Re: [Caml-list] C binding and GC interaction: storing values outside the heap
Date: Tue, 07 Sep 2010 23:12:28 +0200 [thread overview]
Message-ID: <4C86AABC.3010501@glondu.net> (raw)
In-Reply-To: <AANLkTi=VCN4+wpKYG_EWUNX5zsBAs5_G_1hb2Y3uJDsu@mail.gmail.com>
Le 07/09/2010 22:58, Paolo Donadeo a écrit :
> I'm writing a Lua API binding
> [...]
> typedef struct ocaml_data
> {
> value state_value;
> value panic_callback;
> } ocaml_data;
> [...]
> /* alloc space for the register entry */
> ocaml_data *data = (ocaml_data*)caml_stat_alloc(sizeof(ocaml_data));
> caml_register_global_root(&(data->panic_callback));
> data->panic_callback = *default_panic_v;
Why don't you call caml_register_global_root on &(data->state_value) as
well?
--
Stéphane
next prev parent reply other threads:[~2010-09-07 21:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-07 20:58 Paolo Donadeo
2010-09-07 21:12 ` Stéphane Glondu [this message]
2010-09-07 21:23 ` [Caml-list] " Paolo Donadeo
2010-09-07 21:48 ` Stéphane Glondu
2010-09-09 8:11 ` Paolo Donadeo
2010-09-07 22:53 ` Damien Doligez
2010-09-09 8:16 ` Paolo Donadeo
2010-09-08 5:06 ` Romain Beauxis
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=4C86AABC.3010501@glondu.net \
--to=steph@glondu.net \
--cc=caml-list@yquem.inria.fr \
--cc=ocaml-lua-devel@lists.forge.ocamlcore.org \
--cc=p.donadeo@gmail.com \
/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