aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-03-01 16:21:30 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:24:45 +0300
commit50c5092c4a37565558e6ffab7602e778b6774e2a (patch)
treebf1b717e4d5f20cbdef454aaa9b8bef68fb8d21e /src
parent1a352601847328eb9f60b5c7068b8f18ab28ddc6 (diff)
Kill the malloc(16) by writing a test with a 1 MB smart pointer type :)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/embind/embind.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index aab20b69..8da583ba 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -601,11 +601,7 @@ RegisteredPointer.prototype.toWireType = function(destructors, handle) {
}
var ptr = staticPointerCast(handle.$$.ptr, fromRawType, this.pointeeType.rawType);
if (this.isSmartPointer) {
- // todo: if ptr == handle.$$.ptr, there's no need to allocate a new smartPtr!
- // todo: _malloc(16) is not big enough
- var smartPtr = _malloc(16);
- handle.$$.pointeeType.smartPointerType.rawConstructor(smartPtr, ptr, handle.$$.smartPtr);
- ptr = smartPtr;
+ ptr = handle.$$.pointeeType.smartPointerType.rawConstructor(ptr, handle.$$.smartPtr);
destructors.push(handle.$$.pointeeType.smartPointerType.rawDestructor);
destructors.push(ptr);
}