Skip to content

Overhaul to_str_common and char::escape_* #7465

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
Jun 30, 2013

Conversation

alexcrichton
Copy link
Member

This stems from trying to perform as few allocations as possible throughout the standard libraries.

This specializes the ToStr implementation for floats/ints separately because it's known that ints will have a maximum length (whereas floats could be very very large).

I also removed a FIXME to remove a malloc from the to_str() of floats in repr.rs because I think that this should be addressed elsewhere. I think that we may not be able to avoid it easily because floats can have such large representations, but regardless this should be a problem with the implementation of float_to_str_bytes_common now and not in the Repr module.

@emberian
Copy link
Member

r+

@alexcrichton
Copy link
Member Author

@cmr, I think that accidentally went on the pull request instead of the commit.

@emberian
Copy link
Member

heh, oops! guess I commented in the wrong tab :p

bors added a commit that referenced this pull request Jun 30, 2013
This stems from trying to perform as few allocations as possible throughout the standard libraries.

This specializes the `ToStr` implementation for floats/ints separately because it's known that ints will have a maximum length (whereas floats could be very very large).

I also removed a `FIXME` to remove a malloc from the `to_str()` of floats in `repr.rs` because I think that this should be addressed elsewhere. I think that we may not be able to avoid it easily because floats can have such large representations, but regardless this should be a problem with the implementation of `float_to_str_bytes_common` now and not in the `Repr` module.
@bors bors closed this Jun 30, 2013
@bors bors merged commit d3155fa into rust-lang:master Jun 30, 2013
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