summaryrefslogtreecommitdiffstats
path: root/rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'rand.c')
-rw-r--r--rand.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/rand.c b/rand.c
index 7539714b..cd4be17d 100644
--- a/rand.c
+++ b/rand.c
@@ -69,11 +69,17 @@ val random_state_s, random_state_var_s, random_warmup_s;
struct cobj_class *random_state_cls;
+static val random_state_clone(val rand_state)
+{
+ return make_random_state(rand_state, nil);
+}
+
static struct cobj_ops random_state_ops = cobj_ops_init(eq,
cobj_print_op,
cobj_destroy_free_op,
cobj_mark_op,
- cobj_eq_hash_op);
+ cobj_eq_hash_op,
+ random_state_clone);
/* Source: bits from /dev/random on a Linux server */
static rand32_t rand_tab[16] = {