File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 8774493dd33c0028ac7e543a88657d00c34e5eeb
2
+ refs/heads/master: c2f28e231f65802d695815b6e40547b5a0e283fc
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ export reserve;
11
11
export reserve_at_least;
12
12
export capacity;
13
13
export len;
14
- export alloc_len;
15
14
export from_fn;
16
15
export from_elem;
17
16
export to_mut;
@@ -142,6 +141,7 @@ fn reserve_at_least<T>(&v: [const T], n: uint) {
142
141
#[ doc = "
143
142
Returns the number of elements the vector can hold without reallocating
144
143
" ]
144
+ #[ inline( always) ]
145
145
fn capacity < T > ( & & v: [ const T ] ) -> uint unsafe {
146
146
let repr: * * unsafe :: vec_repr = :: unsafe:: reinterpret_cast ( addr_of ( v) ) ;
147
147
( * * repr) . alloc / sys:: size_of :: < T > ( )
@@ -154,13 +154,6 @@ pure fn len<T>(&&v: [const T]) -> uint unsafe {
154
154
( * * repr) . fill / sys:: size_of :: < T > ( )
155
155
}
156
156
157
- #[ doc = "Returns the number of bytes allocated for this vector" ]
158
- #[ inline( always) ]
159
- pure fn alloc_len < T > ( & & v: [ const T ] ) -> uint unsafe {
160
- let repr: * * unsafe :: vec_repr = :: unsafe:: reinterpret_cast ( addr_of ( v) ) ;
161
- ( * * repr) . alloc
162
- }
163
-
164
157
#[ doc = "
165
158
Creates and initializes an immutable vector.
166
159
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ impl arena for arena {
25
25
fn alloc_grow ( n_bytes : uint , align : uint ) -> * ( ) {
26
26
// Allocate a new chunk.
27
27
let mut head = list:: head ( self . chunks ) ;
28
- let chunk_size = vec:: alloc_len ( head. data ) ;
28
+ let chunk_size = vec:: capacity ( head. data ) ;
29
29
let new_min_chunk_size = uint:: max ( n_bytes, chunk_size) ;
30
30
head = chunk ( uint:: next_power_of_two ( new_min_chunk_size + 1 u) ) ;
31
31
self . chunks = list:: cons ( head, @self . chunks ) ;
@@ -41,7 +41,7 @@ impl arena for arena {
41
41
let mut start = head. fill ;
42
42
start = ( start + alignm1) & !alignm1;
43
43
let end = start + n_bytes;
44
- if end > vec:: alloc_len ( head. data ) {
44
+ if end > vec:: capacity ( head. data ) {
45
45
ret self . alloc_grow ( n_bytes, align) ;
46
46
}
47
47
You can’t perform that action at this time.
0 commit comments