Merge branch 'handle-stdout'
[SXSI/xpathcomp.git] / src / common_stub.cpp
index dde97fa..781d079 100644 (file)
@@ -6,6 +6,8 @@
 extern "C" {
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <malloc.h>
+
 }
 
 using std::string;
@@ -69,7 +71,7 @@ value alloc_custom_(char* name)
 }
 
 
-extern "C" value sxsi_cpp_init(value unit)
+ML_BINDING value sxsi_cpp_init(value unit)
 {
   struct rlimit rlim;
   init_exception();
@@ -81,11 +83,12 @@ extern "C" value sxsi_cpp_init(value unit)
     rlim.rlim_cur = RLIM_INFINITY;
     setrlimit(RLIMIT_STACK, &rlim);
   };
+  //  mallopt(M_MMAP_THRESHOLD, 0);
 
   return Val_unit;
 }
 
-void sxsi_raise_msg(char * msg)
+void sxsi_raise_msg(const char * msg)
 {
   if (cpp_exception == 0) init_error();
   caml_raise_with_string(*cpp_exception, msg);