Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElinor Fung <elfung@microsoft.com>2022-01-04 17:22:35 +0300
committerGitHub <noreply@github.com>2022-01-04 17:22:35 +0300
commitef357af10c4f7f0b491b5dc0dff5a36a9b97d07b (patch)
treeea10b04ebd489a87ba075f4f6a85e41e7835ee69 /src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop
parent312c66f1fc2f749f56612999cb1adab9ca7fde59 (diff)
[DllImportGenerator] Update buffer size field for custom marshalling (#63316)
Diffstat (limited to 'src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop')
-rw-r--r--src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs b/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs
index d5543df3c88..46cd7302fbf 100644
--- a/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs
+++ b/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs
@@ -52,7 +52,8 @@ namespace System.Runtime.InteropServices.GeneratedMarshalling
/// Number kept small to ensure that P/Invokes with a lot of array parameters doesn't
/// blow the stack since this is a new optimization in the code-generated interop.
/// </summary>
- public const int StackBufferSize = 0x200;
+ public const int BufferSize = 0x200;
+ public const bool RequiresStackBuffer = true;
public Span<T> ManagedValues => MemoryMarshal.CreateSpan(ref MemoryMarshal.GetReference(_managedSpan), _managedSpan.Length);
@@ -120,7 +121,8 @@ namespace System.Runtime.InteropServices.GeneratedMarshalling
/// Number kept small to ensure that P/Invokes with a lot of array parameters doesn't
/// blow the stack since this is a new optimization in the code-generated interop.
/// </summary>
- public const int StackBufferSize = ReadOnlySpanMarshaller<T>.StackBufferSize;
+ public const int BufferSize = ReadOnlySpanMarshaller<T>.BufferSize;
+ public const bool RequiresStackBuffer = ReadOnlySpanMarshaller<T>.RequiresStackBuffer;
public Span<T> ManagedValues => _inner.ManagedValues;
@@ -180,7 +182,7 @@ namespace System.Runtime.InteropServices.GeneratedMarshalling
/// Number kept small to ensure that P/Invokes with a lot of span parameters doesn't
/// blow the stack.
/// </summary>
- public const int StackBufferSize = SpanMarshaller<T>.StackBufferSize;
+ public const int BufferSize = SpanMarshaller<T>.BufferSize;
public Span<T> ManagedValues => _inner.ManagedValues;
@@ -251,7 +253,8 @@ namespace System.Runtime.InteropServices.GeneratedMarshalling
/// Number kept small to ensure that P/Invokes with a lot of span parameters doesn't
/// blow the stack.
/// </summary>
- public const int StackBufferSize = SpanMarshaller<T>.StackBufferSize;
+ public const int BufferSize = SpanMarshaller<T>.BufferSize;
+ public const bool RequiresStackBuffer = SpanMarshaller<T>.RequiresStackBuffer;
public Span<T> ManagedValues => _inner.ManagedValues;
@@ -337,7 +340,7 @@ namespace System.Runtime.InteropServices.GeneratedMarshalling
/// <summary>
/// Stack-alloc threshold set to 0 so that the generator can use the constructor that takes a stackSpace to let the marshaller know that the original data span can be used and safely pinned.
/// </summary>
- public const int StackBufferSize = 0;
+ public const int BufferSize = 0;
public Span<T> ManagedValues => _data;