Remove non-reentrant timing function.
[SXSI/xpathcomp.git] / src / common_stub.hpp
index ad15256..45aa0ca 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef COMMON_STUB_H_
-#define COMMON_STUB_H_
+#ifndef COMMON_STUB_HPP_
+#define COMMON_STUB_HPP_
 
 extern "C" {
 #define CAML_NAME_SPACE
@@ -13,6 +13,8 @@ extern "C" {
 #include <caml/bigarray.h>
 }
 #include <typeinfo>
+#include <cstdio>
+#include <cassert>
 
 #define NoAlloc
 
@@ -25,6 +27,7 @@ value alloc_custom_(char* name);
 
 template <class X> X& Obj_val(value v)
 {
+  assert(Tag_val(v) == Custom_tag);
   return * (X*) Data_custom_val(v);
 }