From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 1B27EBC0B for ; Tue, 26 Dec 2006 19:13:24 +0100 (CET) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id kBQIDNVT031063 for ; Tue, 26 Dec 2006 19:13:23 +0100 Received: (qmail invoked by alias); 26 Dec 2006 18:13:23 -0000 Received: from p54A32192.dip0.t-ipconnect.de (EHLO [192.168.2.116]) [84.163.33.146] by mail.gmx.net (mp047) with SMTP; 26 Dec 2006 19:13:23 +0100 X-Authenticated: #20477425 Message-ID: <459166C7.4080005@fantasymail.de> Date: Tue, 26 Dec 2006 19:15:35 +0100 From: micha User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: OCaml Mailing List Subject: allocating memory for c-structures Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at discorde with ID 45916643.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; allocating:01 malloc:01 interfacing:01 lib:01 malloc:01 cheers:01 strings:01 structures:02 external:02 objects:02 seems:03 languages:03 library:03 scheme:05 allocate:06 Normaly I allocate memory for c-structures with malloc or with "new" for c++ objects. Some time ago a read about a library which places external structures in strings of the interfacing languages (it was a scheme lib I think). So instead of using malloc or new I would allocate an ocaml-string and put the c-structure there. So it will be free by the gc. That seems o.k. for me, any comments? I'm missing something? cheers Michael