You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for the cool library. But I ran into a head scratcher. Using the node-ffi example in the README.md, I found that any specific array type constructor used in the FFI declaration has to be the exact constructor used to create the array instances when invoking the FFI'd method -- or a segmentation fault 11 occurs. Said another way, two declarations of a "float array" constructor are not compatible.
I've been digging through this module and ffi. I see that there's a lot behind these "type definitions". Declaring even seemingly the same thing again is different enough to trip up some of the magic. This quirk popped up only because I was in the midst of a refactor. Now that I've reached the inevitable point which the ffi library declaration is in the same module as the invoker, there's no more issue. If it becomes necessary to share types between modules I will simply create a master module that exports them. Thanks.
First, thanks for the cool library. But I ran into a head scratcher. Using the node-ffi example in the README.md, I found that any specific array type constructor used in the FFI declaration has to be the exact constructor used to create the array instances when invoking the FFI'd method -- or a segmentation fault 11 occurs. Said another way, two declarations of a "float array" constructor are not compatible.
If we define
use that in our FFI declaration
then declare the float array constructor a second time
and pass an array created with it to
libadd.add
, a seg fault occurs.A complete simple example can be found in the "bug" branch of my fork.
The text was updated successfully, but these errors were encountered: