Skip to content

[BUG] Unnecessary allocation in ZInput.GetButtion() & ZInput.GetButtonDown() #385

@java-devil

Description

@java-devil

Details:
Jotunn Version: 2.10.3
Jotunn Submodule(if applicable): InputManager
Repeatability(Consistent(100%), Inconsistent(50%), Rare(1%), Unknown(==1)): 100%

Problem Description:
Jotunn.dll!Jotunn.Managers::InputManager.ZInput_GetButton() & Jotunn.dll!Jotunn.Managers::InputManager.ZInput_GetButtonDown() allocate trash (due to concatenation) potentially dozens of times per frame (especially if the critical flow of the mod depends on key presses... as it ofc does for OCDheim 😉). They allocate only ~60B per invocation, so this is more of "makes profiling more difficult to analyze" than "performacne issue".

Expected Behaviour:
I would hope there to be no allocation 😉. If given guidance on prefered implementation - I'm perfectly willing to provide a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions