Skip to content

Commit 1272eaa

Browse files
committed
---
yaml --- r: 4637 b: refs/heads/master c: d1b3ed8 h: refs/heads/master i: 4635: 514b5bd v: v3
1 parent 545f007 commit 1272eaa

File tree

4 files changed

+1
-113
lines changed

4 files changed

+1
-113
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 533becef2f54a0cb0a4b386a3df308bf7ab4ea14
2+
refs/heads/master: d1b3ed8c3f808182d74c4056eb8936943ad356fb

trunk/src/lib/vec.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,6 @@ type dummy = int;
99

1010
native "rust" mod rustrt {
1111
type vbuf;
12-
fn vec_buf[T](v: vec[T], offset: uint) -> vbuf;
13-
fn vec_len[T](v: vec[T]) -> uint;
14-
15-
/**
16-
* Sometimes we modify the vec internal data via vec_buf and need to
17-
* update the vec's fill length accordingly.
18-
*/
19-
fn vec_len_set[T](v: vec[T], n: uint);
20-
21-
/**
22-
* The T in vec_alloc[T, U] is the type of the vec to allocate. The
23-
* U is the type of an element in the vec. So to allocate a vec[U] we
24-
* want to invoke this as vec_alloc[vec[U], U].
25-
*/
26-
fn vec_alloc[T, U](n_elts: uint) -> vec[U];
27-
fn vec_alloc_mut[T, U](n_elts: uint) -> vec[mutable U];
28-
fn refcount[T](v: vec[T]) -> uint;
29-
fn vec_print_debug_info[T](v: vec[T]);
30-
fn vec_from_vbuf[T](v: vbuf, n_elts: uint) -> vec[T];
31-
fn unsafe_vec_to_mut[T](v: vec[T]) -> vec[mutable T];
3212
}
3313

3414
// Local Variables:

trunk/src/rt/rust_builtin.cpp

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -120,74 +120,6 @@ unsupervise(rust_task *task) {
120120
task->unsupervise();
121121
}
122122

123-
extern "C" CDECL rust_vec*
124-
vec_alloc(rust_task *task, type_desc *t, type_desc *elem_t, size_t n_elts)
125-
{
126-
LOG(task, mem, "vec_alloc %" PRIdPTR " elements of size %" PRIdPTR,
127-
n_elts, elem_t->size);
128-
size_t fill = n_elts * elem_t->size;
129-
size_t alloc = next_power_of_two(sizeof(rust_vec) + fill);
130-
void *mem = task->malloc(alloc, "rust_vec", t->is_stateful ? t : NULL);
131-
if (!mem) {
132-
task->fail();
133-
return NULL;
134-
}
135-
rust_vec *vec = new (mem) rust_vec(alloc, 0, NULL);
136-
return vec;
137-
}
138-
139-
extern "C" CDECL rust_vec*
140-
vec_alloc_mut(rust_task *task, type_desc *t, type_desc *elem_t, size_t n_elts)
141-
{
142-
return vec_alloc(task, t, elem_t, n_elts);
143-
}
144-
145-
extern "C" CDECL void *
146-
vec_buf(rust_task *task, type_desc *ty, rust_vec *v, size_t offset)
147-
{
148-
return (void *)&v->data[ty->size * offset];
149-
}
150-
151-
extern "C" CDECL size_t
152-
vec_len(rust_task *task, type_desc *ty, rust_vec *v)
153-
{
154-
return v->fill / ty->size;
155-
}
156-
157-
extern "C" CDECL void
158-
vec_len_set(rust_task *task, type_desc *ty, rust_vec *v, size_t len)
159-
{
160-
LOG(task, stdlib, "vec_len_set(0x%" PRIxPTR ", %" PRIdPTR ") on vec with "
161-
"alloc = %" PRIdPTR
162-
", fill = %" PRIdPTR
163-
", len = %" PRIdPTR
164-
". New fill is %" PRIdPTR,
165-
v, len, v->alloc, v->fill, v->fill / ty->size, len * ty->size);
166-
v->fill = len * ty->size;
167-
}
168-
169-
extern "C" CDECL void
170-
vec_print_debug_info(rust_task *task, type_desc *ty, rust_vec *v)
171-
{
172-
LOG(task, stdlib,
173-
"vec_print_debug_info(0x%" PRIxPTR ")"
174-
" with tydesc 0x%" PRIxPTR
175-
" (size = %" PRIdPTR ", align = %" PRIdPTR ")"
176-
" alloc = %" PRIdPTR ", fill = %" PRIdPTR ", len = %" PRIdPTR
177-
" , data = ...",
178-
v,
179-
ty,
180-
ty->size,
181-
ty->align,
182-
v->alloc,
183-
v->fill,
184-
v->fill / ty->size);
185-
186-
for (size_t i = 0; i < v->fill; ++i) {
187-
LOG(task, stdlib, " %" PRIdPTR ": 0x%" PRIxPTR, i, v->data[i]);
188-
}
189-
}
190-
191123
/* Helper for str_alloc and str_from_vec. Returns NULL as failure. */
192124
static rust_vec*
193125
vec_alloc_with_data(rust_task *task,
@@ -202,22 +134,6 @@ vec_alloc_with_data(rust_task *task,
202134
return new (mem) rust_vec(alloc, fill * elt_size, (uint8_t*)d);
203135
}
204136

205-
extern "C" CDECL rust_vec*
206-
vec_from_vbuf(rust_task *task, type_desc *ty, void *vbuf, size_t n_elts)
207-
{
208-
return vec_alloc_with_data(task, n_elts, n_elts * ty->size, ty->size,
209-
vbuf);
210-
}
211-
212-
extern "C" CDECL rust_vec*
213-
unsafe_vec_to_mut(rust_task *task, type_desc *ty, rust_vec *v)
214-
{
215-
if (v->ref_count != CONST_REFCOUNT) {
216-
v->ref();
217-
}
218-
return v;
219-
}
220-
221137
extern "C" CDECL rust_str*
222138
str_alloc(rust_task *task, size_t n_bytes)
223139
{

trunk/src/rt/rustrt.def.in

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ take_chan
7171
task_sleep
7272
task_yield
7373
task_join
74-
unsafe_vec_to_mut
7574
unsupervise
7675
upcall_chan_target_task
7776
upcall_clone_chan
@@ -113,11 +112,4 @@ upcall_take_task
113112
upcall_take_chan
114113
upcall_vec_append
115114
upcall_yield
116-
vec_alloc
117-
vec_alloc_mut
118-
vec_buf
119-
vec_from_vbuf
120-
vec_len
121-
vec_len_set
122-
vec_print_debug_info
123115

0 commit comments

Comments
 (0)