Skip to content

Unecpected boxing on Raii. #2608

@Ted-Jin-Lab

Description

@Ted-Jin-Lab

public static IEndObject Child(ImU8String strId)
=> new EndUnconditionally(ImGui.EndChild, ImGui.BeginChild(strId));

The EndUnconditionally is a struct, and the return type IEndObject is an interface which is a reference type.

Everytime it returns, it'll box the struct into a reference type.

It has some negative impact on performance.

I think it is better to return the struct itself.

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