diff options
| author | pravic <[email protected]> | 2016-06-06 23:07:53 +0300 |
|---|---|---|
| committer | pravic <[email protected]> | 2016-06-06 23:07:53 +0300 |
| commit | f2db0929feeb53567655dbdebba7e6b1c3f2f69e (patch) | |
| tree | c2cf041f838782f9ddd8994146f52e8f498bfe07 /liballoc/raw_vec.rs | |
| parent | add 'netio' native import library (diff) | |
| parent | Merge branch 'nofp_patch' into libcore_nofp (diff) | |
| download | kmd-env-rs-master.tar.xz kmd-env-rs-master.zip | |
Diffstat (limited to 'liballoc/raw_vec.rs')
| -rw-r--r-- | liballoc/raw_vec.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/liballoc/raw_vec.rs b/liballoc/raw_vec.rs index c407cef..58c8411 100644 --- a/liballoc/raw_vec.rs +++ b/liballoc/raw_vec.rs @@ -147,6 +147,7 @@ impl<T> RawVec<T> { /// Gets the capacity of the allocation. /// /// This will always be `usize::MAX` if `T` is zero-sized. + #[inline(always)] pub fn cap(&self) -> usize { if mem::size_of::<T>() == 0 { !0 @@ -577,9 +578,9 @@ impl<T> Drop for RawVec<T> { // * We don't overflow `usize::MAX` and actually allocate too little // // On 64-bit we just need to check for overflow since trying to allocate -// `> isize::MAX` bytes will surely fail. On 32-bit we need to add an extra -// guard for this in case we're running on a platform which can use all 4GB in -// user-space. e.g. PAE or x32 +// `> isize::MAX` bytes will surely fail. On 32-bit and 16-bit we need to add +// an extra guard for this in case we're running on a platform which can use +// all 4GB in user-space. e.g. PAE or x32 #[inline] fn alloc_guard(alloc_size: usize) { |