Updated Cyc_io_get_output_bytevector for huge bv's

This commit is contained in:
Justin Ethier 2018-01-03 14:37:39 -05:00
parent 91a7df51dc
commit c16d854631

View file

@ -118,11 +118,10 @@ void Cyc_io_get_output_bytevector(void *data, object cont, object port)
Cyc_rt_raise2(data, "Not an in-memory port", port);
}
{
make_empty_bytevector(bv);
bv.len = p->str_bv_in_mem_buf_len;
bv.data = alloca(sizeof(char) * bv.len);
memcpy(bv.data, p->str_bv_in_mem_buf, p->str_bv_in_mem_buf_len);
return_closcall1(data, cont, &bv);
object bv;
alloc_bytevector(data, bv, p->str_bv_in_mem_buf_len);
memcpy(((bytevector)bv)->data, p->str_bv_in_mem_buf, p->str_bv_in_mem_buf_len);
return_closcall1(data, cont, bv);
}
}