Skip to content

Change Decoder::read_option to allow returning arbitrary types; inline some malloc wrapper fns #5608

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

Merged
merged 2 commits into from
Mar 29, 2013

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Mar 28, 2013

@nikomatsakis pointed out that fn read_option<T>(&self, f: &fn() -> T) -> Option<T> should have this syntax so it can work with custom option types: fn read_option<T>(&self, f: &fn(bool) -> T) -> T.

Also, this also includes some #[inline(always)] on the memory functions in src/libcore/unstable/lang.rs to reduce one level of indirection when allocating memory.

erickt added 2 commits March 28, 2013 13:11
As far as I can tell, this doesn't make rust compile any
faster, but it does at least remove one level of indirection
on malloc, which might help speed up some operations.
This allows read_option to be used with a custom option type instead
of just core::Option.
bors added a commit that referenced this pull request Mar 29, 2013
@nikomatsakis pointed out that `fn read_option<T>(&self, f: &fn() -> T) -> Option<T>` should have this syntax so it can work with custom option types: `fn read_option<T>(&self, f: &fn(bool) -> T) -> T`.

Also, this also includes some `#[inline(always)]` on the memory functions in `src/libcore/unstable/lang.rs` to reduce one level of indirection when allocating memory.
@bors bors closed this Mar 29, 2013
@bors bors merged commit aa779c1 into rust-lang:incoming Mar 29, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 17, 2020
Rustup with git subtree

The commits from the last rustup rust-lang#5587, are again included in this rustup, since I rebased the rustup. Lesson learned: never rebase, only merge when working with git subtree.

changelog: none
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

Successfully merging this pull request may close these issues.

3 participants