From: Romain Beauxis <toots@rastageeks.org>
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 16:58:30 +0100 [thread overview]
Message-ID: <200811141658.31079.toots@rastageeks.org> (raw)
In-Reply-To: <15DBBCF2-79EF-4F08-A589-3E1B9B4EECB5@erratique.ch>
Le Friday 14 November 2008 16:10:13 Daniel Bünzli, vous avez écrit :
> I think I understood now, the original value was the custom block.
>
> If you were using the custom block only for finalization issues (not
> serialization, hashing etc.) then one solution would be to replace
> your custom block type by the bigarray itself. An register the
> bigarray with Gc.finalise to deallocate the C pointer at the
> appropriate time. Then you have
>
> type t = bigarray
> let to_bigarray x = x
>
> and no problems.
Yep, that's my current solution.
However, I see little interest to be able to allocate a big array with
CAML_BA_EXTERNAL then.
The only situation where this would be of some interest is for using a caml
callback from C, where you don't want the callback to finalize your data.
But you would never be able to convert a part of a custom data type to big
array.
Thanks for your anwsers.
R.
next prev parent reply other threads:[~2008-11-14 15:58 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 ` [Caml-list] " Daniel Bünzli
2008-11-14 15:10 ` Daniel Bünzli
2008-11-14 15:58 ` Romain Beauxis [this message]
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=200811141658.31079.toots@rastageeks.org \
--to=toots@rastageeks.org \
--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