projects
/
SXSI
/
xpathcomp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be15ae2
)
Allow to pass an explicit destructor when registering a custom tag
author
Kim Nguyễn
<kn@lri.fr>
Wed, 22 Feb 2012 09:13:19 +0000
(10:13 +0100)
committer
Kim Nguyễn
<kn@lri.fr>
Wed, 22 Feb 2012 09:13:19 +0000
(10:13 +0100)
for a given type.
src/common_stub.hpp
patch
|
blob
|
history
diff --git
a/src/common_stub.hpp
b/src/common_stub.hpp
index
5655a30
..
438b5d2
100644
(file)
--- a/
src/common_stub.hpp
+++ b/
src/common_stub.hpp
@@
-39,13
+39,13
@@
template <class X> void sxsi_finalize_custom(value v)
sxsi_finalize_obj(Obj_val<X>(v));
}
sxsi_finalize_obj(Obj_val<X>(v));
}
-template <class X> value sxsi_alloc_custom()
+template <class X> value sxsi_alloc_custom(
void (*finalize)(value) = sxsi_finalize_custom<X>
)
{
char * name = const_cast<char*>(typeid(X).name());
value v = alloc_custom_(name);
if (v == Val_unit) {
{
char * name = const_cast<char*>(typeid(X).name());
value v = alloc_custom_(name);
if (v == Val_unit) {
- register_custom_(name, sizeof(X),
sxsi_finalize_custom<X>
);
+ register_custom_(name, sizeof(X),
finalize
);
v = alloc_custom_(name);
};
return v;
v = alloc_custom_(name);
};
return v;