From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Big array with data managed by another value
Date: Fri, 14 Nov 2008 15:42:38 +0100 [thread overview]
Message-ID: <4A8FA99F-D6C3-4D99-AC8D-E17CEE94C88F@erratique.ch> (raw)
In-Reply-To: <200811141503.43395.toots@rastageeks.org>
Le 14 nov. 08 à 15:03, Romain Beauxis a écrit :
> We can pass the CAML_BA_EXTERNAL flag to the bigarray, so that the
> Gc doesn't
> touch data pointer when deallocating the returned array.
>
> However, what I don't know how to do yet is to also tell the Gc that
> the
> original value should not be deallocated until we have finished
> dealing with
> the returned bigarray.
>
> Is there a clean way to do that ?
I'm not sure I understand what you want to do (what is the original
value ?).
1) If you are wondering about the original data of the allocated big
array then there is no such data if you use alloc_bigarray with
BIGARRAY_EXTERNAL.
2) If you are wondering about how you could deallocate the C pointer
using your own function whenever the bigarray becomes unreachable then
register the bigarray with Gc.finalise and an appropriate function.
Best,
Daniel
next prev parent reply other threads:[~2008-11-14 14:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-14 14:03 Romain Beauxis
2008-11-14 14:42 ` Daniel Bünzli [this message]
2008-11-14 15:10 ` [Caml-list] " Daniel Bünzli
2008-11-14 15:58 ` Romain Beauxis
2008-11-14 16:23 ` Daniel Bünzli
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=4A8FA99F-D6C3-4D99-AC8D-E17CEE94C88F@erratique.ch \
--to=daniel.buenzli@erratique.ch \
--cc=caml-list@inria.fr \
/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