@@ -36,10 +36,10 @@ not tied to the lifetime of the original string/data buffer). If C strings are
3636heavily used in applications, then caching may be advisable to prevent
3737unnecessary amounts of allocations.
3838
39- Be carefull to remember that the memory is managed by libc's malloc and not
40- by jemalloc which is the 'normal' rust memory allocator.
41- That means that the CString pointers should only be freed with
42- alloc::libc_heap::malloc_raw if you intend to do that on your own.
39+ Be carefull to remember that the memory is managed by C allocator API and not
40+ 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.
4343
4444An example of creating and using a C string would be:
4545
@@ -97,7 +97,7 @@ pub struct CString {
9797impl Clone for CString {
9898 /// Clone this CString into a new, uniquely owned CString. For safety
9999 /// reasons, this is always a deep clone with the memory allocated
100- /// with libc 's malloc , rather than the usual shallow clone.
100+ /// with C 's allocator API , rather than the usual shallow clone.
101101 fn clone ( & self ) -> CString {
102102 let len = self . len ( ) + 1 ;
103103 let buf = unsafe { malloc_raw ( len) } as * mut libc:: c_char ;
@@ -136,8 +136,9 @@ impl<S: hash::Writer> hash::Hash<S> for CString {
136136}
137137
138138impl CString {
139- /// Create a C String from a pointer, with memory managed by libc's malloc,
140- /// so do not call it with a pointer allocated by jemalloc.
139+ /// 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.
141142 ///
142143 ///# Failure
143144 ///
0 commit comments