summaryrefslogtreecommitdiff
path: root/byterun/obj.c
diff options
context:
space:
mode:
authorJérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>1998-06-24 19:22:26 +0000
committerJérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>1998-06-24 19:22:26 +0000
commit87b17301f4a408109a0f00f7a297b02c79724bc1 (patch)
tree3942d177b1a77e0c260e39507b6dcc7d1da47581 /byterun/obj.c
parentaf85f7c394f650348ee4ca5b34eb8e99619bc11c (diff)
downloadocaml-87b17301f4a408109a0f00f7a297b02c79724bc1.tar.gz
Nouvelle syntaxe des classes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1997 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/obj.c')
-rw-r--r--byterun/obj.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/byterun/obj.c b/byterun/obj.c
index 47bc34b506..9ccb0eb76e 100644
--- a/byterun/obj.c
+++ b/byterun/obj.c
@@ -63,3 +63,21 @@ value obj_block(value tag, value size) /* ML */
return res;
}
+value obj_dup(value arg) /* ML */
+{
+ value res;
+ mlsize_t sz, i;
+ tag_t tg;
+
+ sz = Wosize_val(arg);
+ if (sz == 0) return arg;
+
+ Begin_root(arg);
+ tg = Tag_val(arg);
+ res = alloc(sz, tg);
+ for (i = 0; i < sz; i++)
+ Field(res, i) = Field(arg, i);
+ End_roots();
+
+ return res;
+}