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 NAA15373; Thu, 13 Feb 2003 13:26:53 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA15759 for caml-list@pauillac.inria.fr; Thu, 13 Feb 2003 13:26:52 +0100 (MET) 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 HAA05011 for ; Thu, 13 Feb 2003 07:40:07 +0100 (MET) Received: from mailout08.sul.t-online.com (mailout08.sul.t-online.com [194.25.134.20]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h1D6e7P11530 for ; Thu, 13 Feb 2003 07:40:07 +0100 (MET) Received: from fwd02.sul.t-online.de by mailout08.sul.t-online.com with smtp id 18jD2T-0004df-02; Thu, 13 Feb 2003 07:40:05 +0100 Received: from juist (520046482682-0001@[217.230.17.220]) by fmrl02.sul.t-online.com with esmtp id 18jD2J-030zFwC; Thu, 13 Feb 2003 07:39:55 +0100 Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 18jD2G-0005dm-00 for ; Thu, 13 Feb 2003 07:39:52 +0100 X-Face: "iUeUu$b*W_"w?tV83Y3*r:`rh&dRv}$YnZ3,LVeCZSYVuf[Gpo*5%_=/\_!gc_,SS}[~xZ wY77I-M)xHIx:2f56g%/`SOw"Dx%4Xq0&f\Tj~>|QR|vGlU}TBYhiG(K:2 Date: 13 Feb 2003 07:39:52 +0100 Message-ID: <878ywkbs5j.fsf@student.uni-tuebingen.de> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.5 (broccoli) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender: 520046482682-0001@t-dialin.net Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I would like to use C functions to manipulate small binary objects and Ocaml to manage these objects in data structures. So far, I used alloc_small(WORDS, Abstract_tag) to allocate them. However, that means I cannot put them into a Hashtbl, and I cannot compare them. Do I need "custom blocks" to achieve that? I don't really need any fancy comparison or hash function, plain memcmp and hash would do. So I would like to save the overhead of one pointer per object and the more costly calling. Also, I'm wondering when exactly I need CAMLparam/local. I would think that if I don't allocate anything in the C function, I don't need to protect locals. The manual doesn't mention that, though. Also, I would think that values that are really ints don't need protection... Finally, I wonder why the first parameter to alloc_custom (the ops block) is not a const pointer? -- Falk ------------------- 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