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

Unnecessary sink state #1585

Closed
rsmmr opened this issue Nov 3, 2023 · 0 comments · Fixed by #1677
Closed

Unnecessary sink state #1585

rsmmr opened this issue Nov 3, 2023 · 0 comments · Fixed by #1677
Assignees
Labels
Codegen Enhancement Improvement of existing functionality

Comments

@rsmmr
Copy link
Member

rsmmr commented Nov 3, 2023

Given this input:

module Test;

public type Foo = unit {
    sink b;
};

Having the sink in there leads to this struct:

struct Foo : ::hilti::rt::trait::isStruct, ::hilti::rt::Controllable<Foo> {
        ::hilti::rt::StrongReference<::spicy::rt::Sink> b{};
        ::spicy::rt::sink::detail::State* __sink{};
        [...]
    };

__sink seems unnecessary here because there's nothing connecting Foo itself to a sink. Would be nice if we could optimize that out.

Note: This isn't a huge thing. At first I thought we're instantiating the full sink state already but then I realized it's just a pointer left null until there's a connect happening.

@rsmmr rsmmr added Enhancement Improvement of existing functionality Codegen labels Nov 3, 2023
@bbannier bbannier self-assigned this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codegen Enhancement Improvement of existing functionality
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants