Version française
Home     About     Download     Resources     Contact us    
Browse thread
Bug in memory.h in ocaml 2.03?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: miles <milese@p...>
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 */