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

book: Add documentation on custom allocators #28869

Merged
merged 1 commit into from
Oct 9, 2015

Conversation

alexcrichton
Copy link
Member

This adds a chapter to the nightly section of the book on leveraging and
implementing the #![allocator] attribute to write custom allocators as well as
explaining the current situation with allocators.

@rust-highfive
Copy link
Collaborator

r? @steveklabnik

(rust_highfive has picked a reviewer for you, use r? to override)

let a = Box::new(4); // allocates from jemalloc
println!("{}", a);
}
# fn main() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is declared to be a dylib, why is main present?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC Rustdoc has issues here, basically

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah this is just needed to appears rustdoc --test, the dylib above if for readers and the fn main is needed because rustdoc overrides the crate_type in the source with a manual specification.

@steveklabnik
Copy link
Member

🤘 ❤️

decision can be left up the compiler.

Dynamic and static libraries, however, will use `alloc_system` by default. Here
Rust is typically a "guest" in another application or another world where it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emphasis uses ' not "

@steveklabnik
Copy link
Member

Looks great to me! Just some nits.

@alexcrichton
Copy link
Member Author

re-r? @steveklabnik

// Our system allocator will use the in-tree libc crate for FFI bindings. Note
// that currently the external (crates.io) libc cannot be used because it links
// to the standard library (e.g. `#![no_std]` isn't stable yet), so that's why
// this specifically requires the in-tree version.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Oct 6, 2015

📌 Commit 9a38747 has been approved by steveklabnik

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 7, 2015
…klabnik

This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Oct 7, 2015
…klabnik

This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.
@steveklabnik
Copy link
Member

@bors: r-

@steveklabnik
Copy link
Member

@alexcrichton
Copy link
Member Author

@bors: r=steveklabnik 994a577 rollup

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Oct 8, 2015
…klabnik

This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.
@steveklabnik
Copy link
Member

@steveklabnik
Copy link
Member

@bors: r-

This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.
@alexcrichton
Copy link
Member Author

@bors: r=steveklabnik abe7874

@bors
Copy link
Contributor

bors commented Oct 9, 2015

⌛ Testing commit abe7874 with merge 7cea9a7...

bors added a commit that referenced this pull request Oct 9, 2015
This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.
@bors bors merged commit abe7874 into rust-lang:master Oct 9, 2015
@steveklabnik
Copy link
Member

🎊

On Fri, Oct 9, 2015 at 4:53 AM, bors notifications@github.com wrote:

Merged #28869 #28869.


Reply to this email directly or view it on GitHub
#28869 (comment).

@alexcrichton alexcrichton deleted the allocator-dox branch October 21, 2015 06:14
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.

5 participants