diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1995-07-27 17:41:09 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1995-07-27 17:41:09 +0000 |
commit | 863984ea8ba4be4fc317680c3c457aa8f89c2c72 (patch) | |
tree | bf5238495f6f944178e294c623a68ceafee97df5 /byterun/extern.c | |
parent | b44ab158b2735be981330ff8a0d696051a246cc6 (diff) |
Ajout du tag Double_array_tag.
Deplacement de copy_double dans floats.c.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@153 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/extern.c')
-rw-r--r-- | byterun/extern.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/byterun/extern.c b/byterun/extern.c index 4be22d62a..07ead7e0d 100644 --- a/byterun/extern.c +++ b/byterun/extern.c @@ -175,14 +175,23 @@ static void emit_compact(chan, v) break; } case Double_tag: { - double buffer; if (sizeof(double) != 8) invalid_argument("output_value: non-standard floats"); putch(chan, CODE_DOUBLE_NATIVE); - buffer = Double_val(v); - putblock(chan, (char *) &buffer, 8); - size_32 += 1 + sizeof(double) / 4; - size_64 += 1 + sizeof(double) / 8; + putblock(chan, (char *) v, 8); + size_32 += 1 + 2; + size_64 += 1 + 1; + break; + } + case Double_array_tag: { + mlsize_t nfloats; + if (sizeof(double) != 8) + invalid_argument("output_value: non-standard floats"); + nfloats = Wosize_val(v) / Double_wosize; + output32(chan, CODE_DOUBLE_ARRAY_NATIVE, nfloats); + putblock(chan, (char *) v, Bosize_val(v)); + size_32 += 1 + nfloats * 2; + size_64 += 1 + nfloats; break; } case Abstract_tag: |