aboutsummaryrefslogtreecommitdiff
path: root/system/include
diff options
context:
space:
mode:
authorAndy Friesen <andy@imvu.com>2013-12-04 12:43:42 -0800
committerBruce Mitchener <bruce.mitchener@gmail.com>2014-02-04 16:18:42 +0700
commit4fa2f8933821050fd10fd973f2f619422a807c94 (patch)
treef336089ae8829ede94e540eef2c5715e44cb5990 /system/include
parent34798ee526774bf5040bf5153575e867c82a72e5 (diff)
Add operator_new to smart_ptr_trait.
Diffstat (limited to 'system/include')
-rw-r--r--system/include/emscripten/bind.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index b9da5304..2562a301 100644
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -689,6 +689,10 @@ namespace emscripten {
static void* share(void* v) {
return 0; // no sharing
}
+
+ static PointerType* operator_new() {
+ return new PointerType;
+ }
};
// specialize if you have a different pointer type
@@ -720,6 +724,10 @@ namespace emscripten {
val_deleter(val::take_ownership(v)));
}
+ static PointerType* operator_new() {
+ return new PointerType;
+ }
+
private:
class val_deleter {
public:
@@ -880,7 +888,7 @@ namespace emscripten {
typeid(PointerType).name(),
PointerTrait::get_sharing_policy(),
reinterpret_cast<GenericFunction>(&PointerTrait::get),
- reinterpret_cast<GenericFunction>(&operator_new<PointerType>),
+ reinterpret_cast<GenericFunction>(&PointerTrait::operator_new),
reinterpret_cast<GenericFunction>(&PointerTrait::share),
reinterpret_cast<GenericFunction>(&raw_destructor<PointerType>));
return *this;