[erlang-questions] Accessing A Binary as an Array of Floats/Doubles Within a NIF
Mon Jun 20 21:46:45 CEST 2016
On Mon, Jun 20, 2016 at 3:04 PM, John Duffy <> wrote:
> I'm using FreeBSD 10.3 & Erlang 18.3 and I'm trying to get to grips with
> passing a binary of floats to a NIF for further processing as as array of C
> My simple NIF module compiles and I can access my "my_nif_1" function from
> the erlang shell. I can access the 'size' structure member but I can't
> figure out how to access the 'data' structure member as a C array. I
> understand that 'data' is a block of memory of UINT bytes but I can't
> figure out how to "cast" this to a C array within the NIF.
This doesn't answer your casting question, but is there a reason you're
using a binary and not a resource? See the "Resource Objects" section under
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions