Skip to content

Commit a1c47c3

Browse files
committed
---
yaml --- r: 136541 b: refs/heads/dist-snap c: 50d179d h: refs/heads/master i: 136539: cf2ce62 v: v3
1 parent 21f360c commit a1c47c3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 189b7332968972f34cdbbbd9b62d97ababf53059
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 6a37692ecbb88cd9c3ae06a7ae9d619aa535719d
9+
refs/heads/dist-snap: 50d179d0016ea5f3a3c820a45cdaa6921f9fb14c
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustrt/c_str.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ unnecessary amounts of allocations.
3838
3939
Be carefull to remember that the memory is managed by C allocator API and not
4040
by 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
4445
An 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

138139
impl 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

Comments
 (0)