Skip to content

Adding memcmp intrisinc? #11847

@ayende

Description

@ayende

We are using memcmp a lot, to do comparisons of pieces of data inside mmap file.
Because of the cost of p/invoke, we wrote our own memory comparison function and only shell to memcmp if the size is large enough to be worth it.

I would rather be able to directly call memcmp without paying the pinvoke costs.
Calls to memset and memcpy are already exposed via Unsafe.InitBlock and Unsafe.CopyBlock, respectively.
See:
https://github.com/dotnet/corefx/blob/64c6d9fe5409be14bdc3609d73ffb3fea1f35797/src/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.il#L162

What would be the process of adding a similar functionality for exposing memcmp ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions