summaryrefslogtreecommitdiff
path: root/byterun/io.c
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>1999-11-29 19:03:05 +0000
committerDamien Doligez <damien.doligez-inria.fr>1999-11-29 19:03:05 +0000
commit63e272ecc5bdc544843f8ccf3991552ee98e6643 (patch)
tree0c2ba1d1c1c87b5423c5b56a39234751f93723bf /byterun/io.c
parentde805ef04e9e8dbcaf40905aaec8186cea86dbcf (diff)
downloadocaml-63e272ecc5bdc544843f8ccf3991552ee98e6643.tar.gz
Begin_roots -> CAMLparam
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2617 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/io.c')
-rw-r--r--byterun/io.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/byterun/io.c b/byterun/io.c
index 767b8ff9fd..24949c5789 100644
--- a/byterun/io.c
+++ b/byterun/io.c
@@ -461,32 +461,31 @@ value caml_output_int(value vchannel, value w) /* ML */
value caml_output_partial(value vchannel, value buff, value start, value length) /* ML */
{
+ CAMLparam4 (vchannel, buff, start, length);
struct channel * channel = Channel(vchannel);
int res;
- Begin_root(buff)
- Lock(channel);
- res = putblock(channel, &Byte(buff, Long_val(start)), Long_val(length));
- Unlock(channel);
- End_roots();
- return Val_int(res);
+
+ Lock(channel);
+ res = putblock(channel, &Byte(buff, Long_val(start)), Long_val(length));
+ Unlock(channel);
+ CAMLreturn (Val_int(res));
}
value caml_output(value vchannel, value buff, value start, value length) /* ML */
{
+ CAMLparam4 (vchannel, buff, start, length);
struct channel * channel = Channel(vchannel);
long pos = Long_val(start);
long len = Long_val(length);
- Begin_root(buff)
- Lock(channel);
- while (len > 0) {
- int written = putblock(channel, &Byte(buff, pos), len);
- pos += written;
- len -= written;
- }
- Unlock(channel);
- End_roots();
- return Val_unit;
+ Lock(channel);
+ while (len > 0) {
+ int written = putblock(channel, &Byte(buff, pos), len);
+ pos += written;
+ len -= written;
+ }
+ Unlock(channel);
+ CAMLreturn (Val_unit);
}
value caml_seek_out(value vchannel, value pos) /* ML */
@@ -530,15 +529,14 @@ value caml_input_int(value vchannel) /* ML */
value caml_input(value vchannel, value buff, value start, value length) /* ML */
{
+ CAMLparam4 (vchannel, buff, start, length);
struct channel * channel = Channel(vchannel);
long res;
- Begin_root(buff)
- Lock(channel);
- res = getblock(channel, &Byte(buff, Long_val(start)), Long_val(length));
- Unlock(channel);
- End_roots();
- return Val_long(res);
+ Lock(channel);
+ res = getblock(channel, &Byte(buff, Long_val(start)), Long_val(length));
+ Unlock(channel);
+ CAMLreturn (Val_long(res));
}
value caml_seek_in(value vchannel, value pos) /* ML */