File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,10 @@ rand_gen_seed(uint8_t* dest, size_t size) {
86
86
87
87
extern " C" CDECL void *
88
88
rand_new_seeded (uint8_t * seed, size_t seed_size) {
89
- rust_task *task = rust_get_current_task ();
90
- rust_rng *rng = (rust_rng *) task->malloc (sizeof (rust_rng),
91
- " rand_new_seeded" );
92
- if (!rng) {
93
- task->fail ();
94
- return NULL ;
95
- }
96
- char *env_seed = task->kernel ->env ->rust_seed ;
97
- rng_init (rng, env_seed, seed, seed_size);
89
+ assert (seed != NULL );
90
+ rust_rng *rng = (rust_rng *) malloc (sizeof (rust_rng));
91
+ assert (rng != NULL && " rng alloc failed" );
92
+ rng_init (rng, NULL , seed, seed_size);
98
93
return rng;
99
94
}
100
95
@@ -105,8 +100,7 @@ rand_next(rust_rng *rng) {
105
100
106
101
extern " C" CDECL void
107
102
rand_free (rust_rng *rng) {
108
- rust_task *task = rust_get_current_task ();
109
- task->free (rng);
103
+ free (rng);
110
104
}
111
105
112
106
You can’t perform that action at this time.
0 commit comments