]> Sergey Matveev's repositories - go-opus.git/commit
Move callbacks struct to C allocator, to be safe
authorHraban Luyat <hraban@0brg.net>
Mon, 22 Aug 2016 14:11:13 +0000 (15:11 +0100)
committerHraban Luyat <hraban@0brg.net>
Mon, 22 Aug 2016 14:11:13 +0000 (15:11 +0100)
commit223a3b298ca7b9dbf0b06ab6c50c66320f9dfa60
tree03d391fc62eef48dfb5d21f46e6ad7bc2353ef16
parent3bccc0a7816c2ea55982f5b7a445013beef61058
Move callbacks struct to C allocator, to be safe

I'm not sure if the Go pointer proposal has already been implemented,
but under the proposed restrictions allocating the callback struct in Go
and passing that pointer to a C function which keeps it after returning
is not allowed.

This patch allocates the struct in C and passes the pointer from Go to
C, which is fine.
callbacks.c [new file with mode: 0644]
stream.go