For layout, kind of, but in general, it depends. Since immutable are, well, not mutable, it is actually preferable to use mutable struct in this case so that the C library can easily mutate the struct.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Best way to have GC manage freeing C-allocated storage | 8 | 541 | August 25, 2022 | |
| C struct garbage collection not run frequently enough | 28 | 612 | July 14, 2024 | |
| Opaque pointers and ccall mem. management | 0 | 462 | September 23, 2019 | |
| Memory management issue (malloc) on macBook Pro M2 | 7 | 793 | April 11, 2023 | |
| Finalizer only works with mutable structs? | 74 | 3824 | December 21, 2019 |