TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Proposal: Expose a zero allocation API to Godot C# bindings

5 pointsby tehnubover 1 year ago

1 comment

Rapzidover 1 year ago
There may be some confusion about Span&lt;T&gt; still. Everyone talking about &quot;span&quot; from the C# side is of course talking about Span&lt;T&gt;, which is just a way to represent a contiguous memory segment that doesn&#x27;t need to be managed. It&#x27;s not 100% clear to me what reduz means that Spans can&#x27;t happen, but then Span interfaces can happen. I wonder if there is some conflation with C++ span and C# Span&lt;T&gt;: C# <i>does not</i> need GDExtension to expose spans on its end for C# use Span&lt;T&gt;.<p>The definition of PackedVector2Array is:<p><pre><code> typedef Vector&lt;Vector2&gt; PackedVector2Array; </code></pre> So, it&#x27;s just a Vector? Internally there is PackedArrayRef&lt;T&gt; which wraps Vector&lt;T&gt; and adds a ref count to the struct.<p>Right, so in C# as an implementation detail on its end Span&lt;T&gt; can be used to operate over the Vector&lt;T&gt;. These are all just details though, I think everyone will end up with what they want more or less.