X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fcommon_stub.hpp;h=47b6dcd7e5ba98d7ac1d2836128039b84dd20c58;hb=8a31bd5c0847ca9c45627cb808a57d9c07c7b0dc;hp=5655a309cef9402872b4acac19d67d7399e33360;hpb=813b239795aac1844eb233dab7f8f98d8dba845e;p=SXSI%2Fxpathcomp.git diff --git a/src/common_stub.hpp b/src/common_stub.hpp index 5655a30..47b6dcd 100644 --- a/src/common_stub.hpp +++ b/src/common_stub.hpp @@ -11,7 +11,6 @@ extern "C" { #include #include #include - } #include @@ -39,13 +38,13 @@ template void sxsi_finalize_custom(value v) sxsi_finalize_obj(Obj_val(v)); } -template value sxsi_alloc_custom() +template value sxsi_alloc_custom(void (*finalize)(value) = sxsi_finalize_custom) { char * name = const_cast(typeid(X).name()); value v = alloc_custom_(name); if (v == Val_unit) { - register_custom_(name, sizeof(X), sxsi_finalize_custom); + register_custom_(name, sizeof(X), finalize); v = alloc_custom_(name); }; return v;