Make _io.buf_reader read more than 0 bytes at a time.

This commit is contained in:
Roy Frostig
2010-08-19 17:37:22 -07:00
parent b6b348a13c
commit 4a7aa75b5d
3 changed files with 46 additions and 9 deletions

View File

@@ -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,