-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DllImportGenerator] Update buffer size field for custom marshalling #63316
Conversation
<value>A type that supports marshalling from managed to native using a caller-allocated buffer should also support marshalling from managed to native where using a caller-allocated buffer is impossible.</value> | ||
</data> | ||
<data name="CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackMessage" xml:space="preserve"> | ||
<value>Native type '{0}' has a constructor taking a caller-allocated buffer, but does not support marshalling in scenarios where using a caller-allocated buffer is impossible</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<value>Native type '{0}' has a constructor taking a caller-allocated buffer, but does not support marshalling in scenarios where using a caller-allocated buffer is impossible</value> | |
<value>Native type '{0}' has a constructor taking a caller-allocated buffer, but does not support marshalling in scenarios where using a caller-allocated buffer is impossible.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is a single sentence, I believe the message should not have the period (RS1032).
src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.resx
Outdated
Show resolved
Hide resolved
@@ -708,7 +708,8 @@ public Native(S s) | |||
|
|||
public S ToManaged() => new S { b = i != 0 }; | |||
|
|||
public const int StackBufferSize = 1; | |||
public const int BufferSize = 1; | |||
public const bool RequiresStackBuffer = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a test with RequiresStackBuffer = false;
?
…rator/Resources.resx Co-authored-by: Dan Moseley <[email protected]>
Update from #60374.
This is still always using stackalloc, so
RequiresStackBuffer
is not actually checked yet.@AaronRobinsonMSFT @jkoritzinsky