From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: OCaml Mailing List <caml-list@inria.fr>
Cc: Romain Beauxis <toots@rastageeks.org>
Subject: Re: [Caml-list] Big array with data managed by another value
Date: Fri, 14 Nov 2008 17:23:04 +0100 [thread overview]
Message-ID: <7575FB76-0B64-4AE3-8A13-00F6514AFBA9@erratique.ch> (raw)
In-Reply-To: <200811141658.31079.toots@rastageeks.org>
Le 14 nov. 08 à 16:58, Romain Beauxis a écrit :
> Yep, that's my current solution.
Another less friendly solution is to provide the bigarray in a
callback and document the fact that the bigarray is only valid for the
call and should not escape the scope.
val with_bigarray : custom -> (bigarray -> 'a) -> 'a
let with_bigarray c f =
let ba = barray_of c in
try let r = f ba in barray_invalidate ba; r with e ->
barray_invalidate ba; raise e
barray_invalidate should set the bigarray size to 0 so that if the
client doesn't respect the policy it will only get an out of bounds
error (unless he compiled with -unsafe).
Best,
Daniel
prev parent reply other threads:[~2008-11-14 16:24 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
2008-11-14 16:23 ` Daniel Bünzli [this message]
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=7575FB76-0B64-4AE3-8A13-00F6514AFBA9@erratique.ch \
--to=daniel.buenzli@erratique.ch \
--cc=caml-list@inria.fr \
--cc=toots@rastageeks.org \
/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;
as well as URLs for NNTP newsgroup(s).