From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA09220; Thu, 3 Oct 2002 12:01:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA09147 for ; Thu, 3 Oct 2002 12:01:12 +0200 (MET DST) Received: from relay-5v.club-internet.fr (relay-5v.club-internet.fr [194.158.96.110]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g93A1BD21101 for ; Thu, 3 Oct 2002 12:01:12 +0200 (MET DST) Received: from warp (lns08v-6-227.w.club-internet.fr [212.194.161.227]) by relay-5v.club-internet.fr (Postfix) with SMTP id BB57816D9; Thu, 3 Oct 2002 12:01:10 +0200 (CEST) Message-ID: <008201c26ac3$f40aca30$3000a8c0@warp> From: "Nicolas Cannasse" To: , "IKEDA Katsumi" References: <20021003135922G.ikeda@msi.co.jp> Subject: Re: [Caml-list] Data_custom_val() Date: Thu, 3 Oct 2002 12:02:15 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > CAMLprim value ocaml_foo_record(value unit) > { > CAMLparam1(unit); > value block; > block = alloc_custom(&ops, sizeof(char *), sizeof(char *), 100); > #if 0 > Field(block, 1) = (value)malloc(1024*1024); > #else > *((char *)Data_custom_val(block)) = *((char *)malloc(1024*1024)); Sorry I replied a little too fast. Looks like this last line is using one more indirection. *((char **)Data_custom_val(block)) = (char *)malloc(1024*1024); Looks better. Nicolas Cannasse ------------------- 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