15
15
#[ cfg( not( test) ) ] use core:: raw;
16
16
#[ cfg( not( test) ) ] use util;
17
17
18
- /// Return a pointer to `size` bytes of memory.
18
+ /// Returns a pointer to `size` bytes of memory.
19
19
///
20
20
/// Behavior is undefined if the requested size is 0 or the alignment is not a
21
21
/// power of 2. The alignment must be no larger than the largest supported page
@@ -25,7 +25,7 @@ pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
25
25
imp:: allocate ( size, align)
26
26
}
27
27
28
- /// Extend or shrink the allocation referenced by `ptr` to `size` bytes of
28
+ /// Extends or shrinks the allocation referenced by `ptr` to `size` bytes of
29
29
/// memory.
30
30
///
31
31
/// Behavior is undefined if the requested size is 0 or the alignment is not a
@@ -41,10 +41,10 @@ pub unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint,
41
41
imp:: reallocate ( ptr, size, align, old_size)
42
42
}
43
43
44
- /// Extend or shrink the allocation referenced by `ptr` to `size` bytes of
44
+ /// Extends or shrinks the allocation referenced by `ptr` to `size` bytes of
45
45
/// memory in-place.
46
46
///
47
- /// Return true if successful, otherwise false if the allocation was not
47
+ /// Returns true if successful, otherwise false if the allocation was not
48
48
/// altered.
49
49
///
50
50
/// Behavior is undefined if the requested size is 0 or the alignment is not a
@@ -60,7 +60,7 @@ pub unsafe fn reallocate_inplace(ptr: *mut u8, size: uint, align: uint,
60
60
imp:: reallocate_inplace ( ptr, size, align, old_size)
61
61
}
62
62
63
- /// Deallocate the memory referenced by `ptr`.
63
+ /// Deallocates the memory referenced by `ptr`.
64
64
///
65
65
/// The `ptr` parameter must not be null.
66
66
///
@@ -72,14 +72,14 @@ pub unsafe fn deallocate(ptr: *mut u8, size: uint, align: uint) {
72
72
imp:: deallocate ( ptr, size, align)
73
73
}
74
74
75
- /// Return the usable size of an allocation created with the specified the
75
+ /// Returns the usable size of an allocation created with the specified the
76
76
/// `size` and `align`.
77
77
#[ inline]
78
78
pub fn usable_size ( size : uint , align : uint ) -> uint {
79
79
imp:: usable_size ( size, align)
80
80
}
81
81
82
- /// Print implementation-defined allocator statistics.
82
+ /// Prints implementation-defined allocator statistics.
83
83
///
84
84
/// These statistics may be inconsistent if other threads use the allocator
85
85
/// during the call.
@@ -88,7 +88,7 @@ pub fn stats_print() {
88
88
imp:: stats_print ( ) ;
89
89
}
90
90
91
- // The compiler never calls `exchange_free` on ~ ZeroSizeType, so zero-size
91
+ // The compiler never calls `exchange_free` on Box< ZeroSizeType> , so zero-size
92
92
// allocations can point to this `static`. It would be incorrect to use a null
93
93
// pointer, due to enums assuming types like unique pointers are never null.
94
94
pub static mut EMPTY : uint = 12345 ;
0 commit comments