Using the field isn’t the issue, using a variable has the same effect (except that now the issue is that you are not passing a reference to the variable). See Properly using `finalizer`, `ccall`, `cconvert` and `unsafe_convert` - #10 by yuyichao and Properly using `finalizer`, `ccall`, `cconvert` and `unsafe_convert` - #13 by yuyichao . I prefer not to repeat that whole thing again but let me know which part is unclear in that explaination…
yuyichao
15
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Help converting C code (i2c-dev) | 25 | 4166 | January 24, 2018 | |
| Dereference a pointer | 25 | 4540 | October 6, 2017 | |
| Help with ccall to clib functions | 23 | 2136 | September 7, 2017 | |
| Initialize buffer for ccall | 12 | 964 | January 5, 2021 | |
| Passing a C struct into Julia | 20 | 4472 | February 2, 2021 |