Skip to content

Remove pointless unsafe block in CilAssembler.cs #47

Description

@SeeminglyScience

byte* rawSignature = stackalloc byte[encoder.Builder.Count];
byte* c = rawSignature;
foreach (Blob blob in blobEncoder.Builder.GetBlobs())
{
foreach (byte b in blob.GetBytes())
{
*c++ = b;
}
}
_context.ILInfo.SetLocalSignature(rawSignature, blobEncoder.Builder.Count);

Saves one minor heap allocation every assemble, but not really worth the readability loss and the stackalloc doesn't guard against stack overflow.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions