diff options
| author | bors <bors@rust-lang.org> | 2013-05-08 01:33:38 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-08 01:33:38 -0700 |
| commit | e6529c36af56eedf01dc5db29f9f6408f07e97c3 (patch) | |
| tree | 3355031fb470acc4daffb6807a05e1fb58b5398a /src/rt/rust_builtin.cpp | |
| parent | 625e518ffefaacb95c9bdc0544bc5771cc7a0928 (diff) | |
| parent | 3b6a32d7c90805dab8c08f6969249ac01bce875a (diff) | |
| download | rust-e6529c36af56eedf01dc5db29f9f6408f07e97c3.tar.gz rust-e6529c36af56eedf01dc5db29f9f6408f07e97c3.zip | |
auto merge of #6307 : brson/rust/rng2, r=brson
Closes #6280
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index a491379153e..885b40c0a50 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -88,8 +88,7 @@ rand_seed_size() { extern "C" CDECL void rand_gen_seed(uint8_t* dest, size_t size) { - rust_task *task = rust_get_current_task(); - rng_gen_seed(task->kernel, dest, size); + rng_gen_seed(dest, size); } extern "C" CDECL void * @@ -101,14 +100,14 @@ rand_new_seeded(uint8_t* seed, size_t seed_size) { task->fail(); return NULL; } - rng_init(task->kernel, rng, seed, seed_size); + char *env_seed = task->kernel->env->rust_seed; + rng_init(rng, env_seed, seed, seed_size); return rng; } extern "C" CDECL uint32_t rand_next(rust_rng *rng) { - rust_task *task = rust_get_current_task(); - return rng_gen_u32(task->kernel, rng); + return rng_gen_u32(rng); } extern "C" CDECL void |
