Manipulating and returning typed arrays from a native addon

16 views
Skip to first unread message

S

unread,
Jun 9, 2015, 9:42:48 AM6/9/15
to nod...@googlegroups.com

I'm trying to use a couple of Float32Arrays in a node addon (which needs access to the underlying float buffer) and maybe return a new one, currently I'm using Externalize (like so: http://pastebin.com/2e7z0rgr) to retrieve it, but the doc says that "After ArrayBuffer had been etxrenalized, it does no longer owns the memory block.  The caller should take steps to free memory when it is no longer needed." so it seems that if I don't delete it myself, it'll leak. The thing is I still need those arrays after the function ends. Is there another way to get access to the internal array? Or a way to "Internalize" it back :)  ?

I’m using v0.12.3 and NAN.

Reply all
Reply to author
Forward
0 new messages