Skip to content

Commit f2b0bdd

Browse files
committed
---
yaml --- r: 134607 b: refs/heads/try c: 50d179d h: refs/heads/master i: 134605: 85f9442 134603: 50d18b8 134599: 9fd8046 134591: 2fff197 v: v3
1 parent 64cbe04 commit f2b0bdd

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 58413c09cd52ea4005d6ea7733ba1fb3a8f36589
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 437179ed8bf7f7672f84b19265df1ce569e70490
5-
refs/heads/try: 6a37692ecbb88cd9c3ae06a7ae9d619aa535719d
5+
refs/heads/try: 50d179d0016ea5f3a3c820a45cdaa6921f9fb14c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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)