Browse thread
[Caml-list] Data_custom_val()
-
IKEDA Katsumi
- Nicolas Cannasse
- Nicolas Cannasse
- IKEDA Katsumi
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | IKEDA Katsumi <ikeda@m...> |
| Subject: | Re: [Caml-list] Data_custom_val() |
Hi,
From: Olivier Andrieu <andrieu@ijm.jussieu.fr>
Message-ID: <15771.65438.985931.420887@karryall.dnsalias.org>
>
> You don't need to call malloc, alloc_custom can allocate the space for
> you :
>
> CAMLprim value ocaml_foo_record(value unit)
> {
> CAMLparam1(unit);
> value block;
> char **data;
> block = alloc_custom(&ops, 1024 * 1024 , 1024 * 1024, 100);
> data = Data_custom_val(block);
> /* store something in the block using *data ... */
> CAMLreturn(block);
> }
I understand.
Thanks.
--
IKEDA Katsumi <ikeda@msi.co.jp>
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners