-extern "C" void caml_hset_finalize(value hblock){
- delete HSET(hblock);
- return;
-}
-
-extern "C" value caml_init_lib (value unit) {
- CAMLparam1(unit);
-
- struct rlimit rlim;
-
- if (!ops_initialized){
-
- getrlimit(RLIMIT_STACK, &rlim);
-
- if (rlim.rlim_max == RLIM_INFINITY && rlim.rlim_cur != RLIM_INFINITY) {
- rlim.rlim_cur = RLIM_INFINITY;
- setrlimit(RLIMIT_STACK, &rlim);
- };
-
- ops.identifier = (char*) "XMLTree";
- ops.finalize = caml_xml_tree_finalize;
- set_ops.identifier = (char*) "unordered_set";
- set_ops.finalize = caml_hset_finalize;
-
- cpp_exception = caml_named_value("CPlusPlusError");
- if (cpp_exception == NULL){
- string s = "FATAL: Unregistered exception ";
- s += "CPlusPlusError";
- caml_failwith(s.c_str());
- };
-
- ops_initialized = true;