Skip to content

What is gd.Lifetime? #16

Answered by Splizard
ShirenY asked this question in Q&A
May 11, 2024 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

why this isn’t the case with other language extensions like C++ and Rust.

This isn't the case for C++ because memory needs to be managed by the developer, this isn't the case for Rust, because the language has memory ownership semantics that provide memory safety. This isn't the case for the official Godot C# bindings, because in C#, Godot memory can be freed by the C# garbage collector, as presumably, C# has reasonable mechanisms to do this when interfacing with C.

Go doesn't have any language-supported (efficient and reliable) way to manage foreign memory (ie. Godot objects and values) via the garbage collector. It has finalizers, but these are not really meant to be used for lots of …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ShirenY
Comment options

@Splizard
Comment options

@ShirenY
Comment options

@Splizard
Comment options

@ShirenY
Comment options

Answer selected by ShirenY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants