Skip to content

Document that CStrings live in the libc heap #17355

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 3 commits into from
Sep 20, 2014
Merged

Conversation

gamazeps
Copy link
Contributor

Insists on the fact that the memory is managed by malloc
and not jemalloc
Closes #17067

Insists on the fact that the memory is managed by malloc
and not jemalloc
Closes rust-lang#17067
@@ -36,6 +36,11 @@ not tied to the lifetime of the original string/data buffer). If C strings are
heavily used in applications, then caching may be advisable to prevent
unnecessary amounts of allocations.

Be carefull to remember that the memory is managed by libc's malloc and not
Copy link
Contributor

Choose a reason for hiding this comment

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

The default memory allocator is not always jemalloc - it's an implementation detail. It shouldn't be mentioned in any of the documentation like this. The libc symbols may also be resolving to symbols provided by jemalloc, so it's not accurate to explain it this way. The only thing the documentation should say is that it's not well defined to mix the C allocator API with the Rust allocator API. The underlying allocator beneath either API is not defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So replacing l
-"libc's malloc" by "C allocator API"
-"jemalloc" by "Rust allocator"
Does the trick ?

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Sep 19, 2014
@bors bors merged commit 50d179d into rust-lang:master Sep 20, 2014
@gamazeps gamazeps deleted the issue17210 branch May 7, 2017 14:52
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.

Document that CStrings live on the libc heap.
4 participants