diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/include/emscripten/bind.h | 10 |
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; |