Skip to content

fix(session): Fix CGO pointer rules - #18

Merged
ananos merged 1 commit into
mainfrom
fix_go_pointers
Sep 1, 2025
Merged

fix(session): Fix CGO pointer rules#18
ananos merged 1 commit into
mainfrom
fix_go_pointers

Conversation

@ananos

@ananos ananos commented Sep 1, 2025

Copy link
Copy Markdown
Member

It seems that Go needs to keep track of memory allocated by itself. However, when this gets mixed with memory allocated from external functions (eg C), things get complicated. In order to avoid these issues, we define all internal structs as pointers to C structures instead of allocated C structure in Go.

It seems that Go needs to keep track of memory allocated by itself.
However, when this gets mixed with memory allocated from external
functions (eg C), things get complicated. In order to avoid these
issues, we define all internal structs as pointers to C structures
instead of allocated C structure in Go.

Signed-off-by: Kostis Papazafeiropoulos <papazof@nubificus.co.uk>
Signed-off-by: Apostolos Giannousas <agian@nubificus.co.uk>
Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
@ananos
ananos merged commit 763a649 into main Sep 1, 2025
4 checks passed
@ananos
ananos deleted the fix_go_pointers branch September 1, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants