diff options
author | Chad Austin <chad@imvu.com> | 2013-03-01 16:21:30 -0800 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:24:45 +0300 |
commit | 50c5092c4a37565558e6ffab7602e778b6774e2a (patch) | |
tree | bf1b717e4d5f20cbdef454aaa9b8bef68fb8d21e /src | |
parent | 1a352601847328eb9f60b5c7068b8f18ab28ddc6 (diff) |
Kill the malloc(16) by writing a test with a 1 MB smart pointer type :)
Diffstat (limited to 'src')
-rwxr-xr-x | src/embind/embind.js | 6 |
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); } |