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

global allocator improvements #18293

Merged
merged 5 commits into from Oct 26, 2014
Merged

global allocator improvements #18293

merged 5 commits into from Oct 26, 2014

Conversation

thestinger
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@emberian
Copy link
Member

Less libc!

dotdash and others added 2 commits October 25, 2014 12:33
With MIN_ALIGN as a static, other crates don't have access to its value
at compile time, because it is an extern global. That means that the
checks against it can't be optimized out, which is rather unfortunate.
So let's make it a constant instead.
The C standard library functions should be used directly. The quirky
NULL / zero-size allocation workaround is no longer necessary and was
adding an extra branch to the allocator code path in a build without
jemalloc. This is a small step towards liballoc being compatible with
handling OOM errors instead of aborting (#18292).

[breaking-change]
The real size is also more useful than just a boolean, and the caller
can easily determine if the operation failed from the real size. In most
cases, the caller is only going to be growing the allocation so a branch
can be avoided.

[breaking-change]
bors added a commit that referenced this pull request Oct 25, 2014
@bors bors closed this Oct 26, 2014
@bors bors merged commit a9e8510 into rust-lang:master Oct 26, 2014
@thestinger thestinger deleted the heap branch October 26, 2014 01:22
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.

None yet

5 participants