diff options
| author | Dylan Braithwaite <dylanbraithwaite1@gmail.com> | 2014-02-18 20:30:21 +0000 |
|---|---|---|
| committer | Dylan Braithwaite <dylanbraithwaite1@gmail.com> | 2014-02-18 20:39:47 +0000 |
| commit | 56114633e88ecb6621ffdd9d69ec0efc32140c60 (patch) | |
| tree | ad74bb0062c9d44d1ebf7d5d36278151c8a892be /src/libstd | |
| parent | a88654977234d18b57e2a1842549941397ab0d59 (diff) | |
| download | rust-56114633e88ecb6621ffdd9d69ec0efc32140c60.tar.gz rust-56114633e88ecb6621ffdd9d69ec0efc32140c60.zip | |
Clarify unit of size in docs for size_of functions.
Changed the docs in mem.rs to clarify the fact the the size functions return sizes in bytes.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/mem.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/mem.rs b/src/libstd/mem.rs index ee05d6a704b..c322e9bf572 100644 --- a/src/libstd/mem.rs +++ b/src/libstd/mem.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -20,19 +20,19 @@ use ptr; use unstable::intrinsics; use unstable::intrinsics::{bswap16, bswap32, bswap64}; -/// Returns the size of a type +/// Returns the size of a type in bytes. #[inline] pub fn size_of<T>() -> uint { unsafe { intrinsics::size_of::<T>() } } -/// Returns the size of the type that `_val` points to +/// Returns the size of the type that `_val` points to in bytes. #[inline] pub fn size_of_val<T>(_val: &T) -> uint { size_of::<T>() } -/// Returns the size of a type, or 1 if the actual size is zero. +/// Returns the size of a type in bytes, or 1 if the actual size is zero. /// /// Useful for building structures containing variable-length arrays. #[inline] @@ -41,7 +41,7 @@ pub fn nonzero_size_of<T>() -> uint { if s == 0 { 1 } else { s } } -/// Returns the size of the type of the value that `_val` points to +/// Returns the size in bytes of the type of the value that `_val` points to. #[inline] pub fn nonzero_size_of_val<T>(_val: &T) -> uint { nonzero_size_of::<T>() |
