From 4a7aa75b5df2dba14ee03fb3a4d87a33ec0fd6dd Mon Sep 17 00:00:00 2001 From: Roy Frostig Date: Thu, 19 Aug 2010 17:37:22 -0700 Subject: Make _io.buf_reader read more than 0 bytes at a time. --- src/rt/rust_builtin.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/rt/rust_builtin.cpp') diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 276ea5582d0..d2bad054014 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -108,6 +108,19 @@ vec_len(rust_task *task, type_desc *ty, rust_vec *v) return v->fill / ty->size; } +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) { @@ -115,8 +128,15 @@ vec_print_debug_info(rust_task *task, type_desc *ty, rust_vec *v) "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, -- cgit 1.4.1-3-g733a5