1
- // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1
+ // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2
2
// file at the top-level directory of this distribution and at
3
3
// http://rust-lang.org/COPYRIGHT.
4
4
//
@@ -20,19 +20,19 @@ use ptr;
20
20
use unstable:: intrinsics;
21
21
use unstable:: intrinsics:: { bswap16, bswap32, bswap64} ;
22
22
23
- /// Returns the size of a type
23
+ /// Returns the size of a type in bytes.
24
24
#[ inline]
25
25
pub fn size_of < T > ( ) -> uint {
26
26
unsafe { intrinsics:: size_of :: < T > ( ) }
27
27
}
28
28
29
- /// Returns the size of the type that `_val` points to
29
+ /// Returns the size of the type that `_val` points to in bytes.
30
30
#[ inline]
31
31
pub fn size_of_val < T > ( _val : & T ) -> uint {
32
32
size_of :: < T > ( )
33
33
}
34
34
35
- /// Returns the size of a type, or 1 if the actual size is zero.
35
+ /// Returns the size of a type in bytes , or 1 if the actual size is zero.
36
36
///
37
37
/// Useful for building structures containing variable-length arrays.
38
38
#[ inline]
@@ -41,7 +41,7 @@ pub fn nonzero_size_of<T>() -> uint {
41
41
if s == 0 { 1 } else { s }
42
42
}
43
43
44
- /// Returns the size of the type of the value that `_val` points to
44
+ /// Returns the size in bytes of the type of the value that `_val` points to.
45
45
#[ inline]
46
46
pub fn nonzero_size_of_val < T > ( _val : & T ) -> uint {
47
47
nonzero_size_of :: < T > ( )
0 commit comments