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

Tail call optimization #9

Open
bestouff opened this issue Oct 29, 2019 · 3 comments
Open

Tail call optimization #9

bestouff opened this issue Oct 29, 2019 · 3 comments

Comments

@bestouff
Copy link

When available in rustc, momo should use tail call optimization to have the best or both worlds: compact binaries and no extra stackframe.

@Artoria2e5
Copy link
Contributor

Doesn't the current format of

    pub fn generic<I: Into<usize>, S: AsRef<str>, M: AsMut<[usize]>>(
        &self,
        i: I,
        s: S,
        mut m: M,
    ) -> usize {
        self._generic_inner(i.into(), s.as_ref(), m.as_mut())
    }

already produce a tail call?

@bestouff
Copy link
Author

bestouff commented Aug 9, 2021

It often does but it's not guaranteed

@Artoria2e5
Copy link
Contributor

Hmm, I guess we will have to wait for become to become a thing then. Apparently something looking like a tail call can still not be one due to Drop and other shenanigans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants