Skip to content

Conversation

@elinor-fung
Copy link
Member

Found that two of the Brotli p/invokes could easily be made blittable (inlinable during JIT) while prototyping a DllImport source generator.

cc @AaronRobinsonMSFT @jkoritzinsky

@ghost
Copy link

ghost commented Jun 10, 2021

Tagging subscribers to this area: @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.

Issue Details

Found that two of the Brotli p/invokes could easily be made blittable (inlinable during JIT) while prototyping a DllImport source generator.

cc @AaronRobinsonMSFT @jkoritzinsky

Author: elinor-fung
Assignees: -
Labels:

area-System.IO.Compression

Milestone: -


[DllImport(Libraries.CompressionNative)]
internal static extern unsafe bool BrotliDecoderDecompress(nuint availableInput, byte* inBytes, ref nuint availableOutput, byte* outBytes);
internal static extern unsafe int BrotliDecoderDecompress(nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes);
Copy link
Member

@jkotas jkotas Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make all of PInvokes in this file to return int for consistency?

Also, would it make sense to use BOOL to make it clear that this is returning boolean value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you talking about that Interop.BOOL enum?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so.

@stephentoub stephentoub merged commit ef9e276 into dotnet:main Jun 11, 2021
@elinor-fung elinor-fung deleted the brotliBlittable branch June 11, 2021 14:39
@ghost ghost locked as resolved and limited conversation to collaborators Jul 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants