Bug in memory.h in ocaml 2.03?

From: miles (milese@pacbell.net)
Date: Sun Nov 21 1999 - 20:39:02 MET


From: miles <milese@pacbell.net>
Date: Sun, 21 Nov 1999 11:39:02 -0800 (PST)
To: caml-list@inria.fr
Subject: Bug in memory.h in ocaml 2.03?

While recompiling Markus Mottl's fabulous pcre wrapper (many thanks
for that, by the way), I hit a snag in a function that uses the
CAMLparam1 macro. I traced it back to a change in the memory.h header
that removes the typedef for caml__root_block. After reinstating the
typedef, everything works as before.

Ocaml with the pcre library is an amazing text processing tool. I've
been evangelizing it at work (an internet perl shop). People were
pretty impressed when I rewrote one of our scripts in ocaml and beat
perl by a factor of 2 in bytecode and a factor of 40 or so in native
code. We occasionally have to write c-level extensions to perl to get
the performance we want. I suspect this would happen much less often
if we used ocaml.

miles

the patch is as follows:
------------------------------------------------------------------------
--- memory.h.old Sun Nov 21 11:31:44 1999
+++ memory.h Sun Nov 21 11:32:05 1999
@@ -46,12 +46,12 @@
 
 
 
-struct caml__roots_block {
+typedef struct caml__roots_block {
   struct caml__roots_block *next;
   long ntables;
   long nitems;
   value *tables [5];
-};
+} caml__roots_block;
 
 extern struct caml__roots_block *local_roots; /* defined in roots.c */



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:28 MET