aboutsummaryrefslogtreecommitdiff
path: root/src/rt
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-08-19 17:37:22 -0700
committerRoy Frostig <[email protected]>2010-08-19 17:37:22 -0700
commit4a7aa75b5df2dba14ee03fb3a4d87a33ec0fd6dd (patch)
treee32837f9692a47d4415d8bd80e8f53aaa64d781d /src/rt
parentExport all item code to stabs on Windows (including e.g. object methods) (diff)
downloadrust-4a7aa75b5df2dba14ee03fb3a4d87a33ec0fd6dd.tar.xz
rust-4a7aa75b5df2dba14ee03fb3a4d87a33ec0fd6dd.zip
Make _io.buf_reader read more than 0 bytes at a time.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 276ea558..d2bad054 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -109,14 +109,34 @@ vec_len(rust_task *task, type_desc *ty, rust_vec *v)
}
extern "C" CDECL void
+vec_len_set(rust_task *task, type_desc *ty, rust_vec *v, size_t len)
+{
+ task->log(rust_log::STDLIB,
+ "vec_len_set(0x%" PRIxPTR ", %" PRIdPTR ") on vec with "
+ "alloc = %" PRIdPTR
+ ", fill = %" PRIdPTR
+ ", len = %" PRIdPTR
+ ". New fill is %" PRIdPTR,
+ v, len, v->alloc, v->fill, v->fill / ty->size, len * ty->size);
+ v->fill = len * ty->size;
+}
+
+extern "C" CDECL void
vec_print_debug_info(rust_task *task, type_desc *ty, rust_vec *v)
{
task->log(rust_log::STDLIB,
"vec_print_debug_info(0x%" PRIxPTR ")"
" with tydesc 0x%" PRIxPTR
" (size = %" PRIdPTR ", align = %" PRIdPTR ")"
- " alloc = %" PRIdPTR ", fill = %" PRIdPTR
- " , data = ...", v, ty, ty->size, ty->align, v->alloc, v->fill);
+ " alloc = %" PRIdPTR ", fill = %" PRIdPTR ", len = %" PRIdPTR
+ " , data = ...",
+ v,
+ ty,
+ ty->size,
+ ty->align,
+ v->alloc,
+ v->fill,
+ v->fill / ty->size);
for (size_t i = 0; i < v->fill; ++i) {
task->log(rust_log::STDLIB,