diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2022-11-27 03:30:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 03:30:59 +0100 |
commit | 690199b7dddd784b435e6ce71365256b29285fe8 (patch) | |
tree | e3e855d1f8ce3f68d9bd3eda2c135e9333c0a520 /modules/mono/editor/bindings_generator.cpp | |
parent | e29b982dbf06fb7bb32257642687df5093d7327c (diff) | |
parent | 3ff181096ac247c1613b1a535726949af3b01b46 (diff) |
Merge pull request #69194 from raulsntos/dotnet/begone-variant-disposer
C#: Remove VariantSpanDisposer and use constants in stackalloc
Diffstat (limited to 'modules/mono/editor/bindings_generator.cpp')
-rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 82b5f478e1..9185506776 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -2542,15 +2542,13 @@ Error BindingsGenerator::_generate_cs_native_calls(const InternalCall &p_icall, << INDENT2 "int total_length = " << real_argc_str << " + vararg_length;\n"; r_output << INDENT2 "Span<godot_variant.movable> varargs_span = vararg_length <= VarArgsSpanThreshold ?\n" - << INDENT3 "stackalloc godot_variant.movable[VarArgsSpanThreshold].Cleared() :\n" + << INDENT3 "stackalloc godot_variant.movable[VarArgsSpanThreshold] :\n" << INDENT3 "new godot_variant.movable[vararg_length];\n"; r_output << INDENT2 "Span<IntPtr> " C_LOCAL_PTRCALL_ARGS "_span = total_length <= VarArgsSpanThreshold ?\n" << INDENT3 "stackalloc IntPtr[VarArgsSpanThreshold] :\n" << INDENT3 "new IntPtr[total_length];\n"; - r_output << INDENT2 "using var variantSpanDisposer = new VariantSpanDisposer(varargs_span);\n"; - r_output << INDENT2 "fixed (godot_variant.movable* varargs = &MemoryMarshal.GetReference(varargs_span))\n" << INDENT2 "fixed (IntPtr* " C_LOCAL_PTRCALL_ARGS " = " "&MemoryMarshal.GetReference(" C_LOCAL_PTRCALL_ARGS "_span))\n" |