@@ -38,8 +38,9 @@ unnecessary amounts of allocations.
3838
3939Be carefull to remember that the memory is managed by C allocator API and not
4040by Rust allocator API.
41- That means that the CString pointers should only be freed with C allocator API
42- if you intend to do that on your own.
41+ That means that the CString pointers should be freed with C allocator API
42+ if you intend to do that on your own, as the behaviour if you free them with
43+ Rust's allocator API is not well defined
4344
4445An example of creating and using a C string would be:
4546
@@ -137,8 +138,8 @@ impl<S: hash::Writer> hash::Hash<S> for CString {
137138
138139impl CString {
139140 /// Create a C String from a pointer, with memory managed by C's allocator
140- /// API, so do not call it with a pointer to memory managed by Rust's
141- /// allocator API.
141+ /// API, so avoid calling it with a pointer to memory managed by Rust's
142+ /// allocator API, as the behaviour would not be well defined .
142143 ///
143144 ///# Failure
144145 ///
@@ -272,7 +273,7 @@ impl CString {
272273 /// forgotten, meaning that the backing allocation of this
273274 /// `CString` is not automatically freed if it owns the
274275 /// allocation. In this case, a user of `.unwrap()` should ensure
275- /// the allocation is freed, to avoid leaking memory. You have to
276+ /// the allocation is freed, to avoid leaking memory. You should
276277 /// use libc's memory allocator in this case.
277278 ///
278279 /// Prefer `.as_ptr()` when just retrieving a pointer to the
0 commit comments