Skip to content
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

Fix evil allocations, marshaling overhead #329

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Apr 13, 2021

  1. Fix evil allocations, marshaling overhead

    StrToPtr() had at least 4 extra allocations of byte[] and char[] arrays that will make Unity's GC and frametime stability sad, taking into account you can updated 5 times per 20 seconds, which is few frames apart.
    Also, there was 0 reason to have that marshaling invoke overhead where it zeroes byte by byte in a loop. There is no point, we already overwrite whole memory via .Copy() and we only allocate as much as needed, no extra. No security concerns here.
    Kein authored Apr 13, 2021
    Configuration menu
    Copy the full SHA
    f62dfa8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a88cabd View commit details
    Browse the repository at this point in the history