Skip to content

Move the Buffer.Memmove<T> implementation into the runtime specific files since it requires a runtime specific BulkMoveWithWriteBarrier icall.#37920

Merged
vargaz merged 1 commit intodotnet:masterfrom
vargaz:memmove
Jun 16, 2020

Conversation

@vargaz
Copy link
Contributor

@vargaz vargaz commented Jun 15, 2020

The mono version has an extra type argument since it uses copy functions which are type specific.
Also add an elementCount > 0 check to avoid icall overhead if possible.

…iles since it requires a runtime specific BulkMoveWithWriteBarrier icall.

The mono version has an extra type argument since it uses copy functions which are type specific.
Also add an elementCount > 0 check to avoid icall overhead if possible.
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. Please help me learn by adding exactly one area label.

ves_icall_System_Buffer_BulkMoveWithWriteBarrier (guint8 *destination, guint8 *source, size_t len, MonoType *type)
{
mono_gc_wbarrier_range_copy (destination, source, byte_count);
if (MONO_TYPE_IS_REFERENCE (type))
Copy link
Member

@lambdageek lambdageek Jun 15, 2020

Choose a reason for hiding this comment

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

Is this ever going to be true if

if (!RuntimeHelpers.IsReferenceOrContainsReferences<T>())

is false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not right now, but more callers could be added in the future.

@vargaz
Copy link
Contributor Author

vargaz commented Jun 16, 2020

The runtime failures look unrelated:
https://dev.azure.com/dnceng/public/_build/results?buildId=689520&view=results

@vargaz vargaz merged commit b74d0e1 into dotnet:master Jun 16, 2020
@vargaz vargaz deleted the memmove branch June 16, 2020 18:07
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants